Developer Onboarding Guide
Fundamental features of the Ably Data Stream Network
1. Ably Realtime and Ably REST Client Library SDKs
Ably's Data Stream Network (DSN) primarily offers realtime Client Library SDKs that allow you to incorporate the Pub/Sub messaging pattern in your apps and operate any number of such persistent publisher or subscriber clients.
However, in many scenarios you may not need persistent connections. Most servers are typically stateless and hence HTTP based REST requests better suit them in order to be able to process each request independently. In many other situations, for example, if you have an IoT sensor that only needs to publish data at certain intervals, you’re better off with a REST request rather than maintaining a persistent connection which leads to battery-drain. For scenarios like this, Ably also offers REST-based Client Library SDKs.
Our best practice guide further explains when to use which library.
Ably requires your clients to authenticate before accessing the Ably Network. We provide two ways of authenticating your clients:
- Basic auth enables your clients to directly plug in API keys. This is quick but not recommended for production level apps, as API keys are vulnerable to misuse when embedded in client-side code.
- Token auth enables you to assign short-lived tokens to your clients, which they can use to authenticate with Ably. This can be an Ably-specific token or a JSON Web Token (JWT). Token auth is a safer and recommended option to use in production level apps.
Presence tells you who is connected to your application and what their status or attributes are. You can use presence in two ways:
- Retrieve a list of ‘online’ clients using Ably’s REST client library SDKs
- Receive notifications for every client that joins or leaves a channel, or simply updates their presence-related data using Ably’s Realtime Client Library SDKs
You can also retrieve the historical presence status of your clients using the History feature described next.
Maintaining strong, persistent internet connections isn’t always an option. And sometimes when a client disconnects from the internet, they might miss any messages sent during that time. To overcome this, Ably persists messages for two minutes by default.
This is configurable to durations of up to 72 hours by using a feature called History. Any client that manages to reconnect during that period will receive any missed messages in the order they were originally sent.
Up next: An overview of Ably's products →