Why would I use SSE over Ably's realtime protocol?

At Ably we believe in protocol interoperability, and whilst we believe our own native realtime protocol in a lot of cases offers the right balance between performance, portability and quality of service, we recognize that developers should be given the choice to choose the right protocol for their applications based on their own use case. As such, we offer support for SSE in addition to a number of other protocols.

 

SSE allows for a request from a client to be held by a server, allowing it to push data to the client without further requests. This, much like WebSockets, help avoid the overhead involved in normal HTTP requests. Server-sent events (SSE) is another method of achieving this for web pages, usually done through the use of EventSource.

 

This is useful when dealing with devices with extremely limited memory, where using one of the Ably client libraries would not be possible. This is possible largely due to it being a subscribe-only method, without the many additional features Ably provides.

 

We recommend you consider SSE if:

  • Ably does not offer a native library that supports your target platform. See the completely list of Ably client libraries.
  • Ably offers a REST-only client library for your target platform, but you need a realtime client
  • You have stringent memory restrictions
  • You only wish to subscribe to events on channels

 

We recommend you use Ably client libraries and our realtime protocol if:

  • You want a high quality of service and high availability even during significant events such DNS failure or network partitions. Find out how we do this.
  • You want access to features such as Publishing, Presence, History, Push notifications, automatic payload encoding, symmetric encryption. See a complete list of Ably features, a lot of which are only available to Ably clients.
  • You want first class browser support with WebSockets.

 

If you would like to use SSE, see our SSE adapter page