Skip to content

Commit 00a94b6

Browse files
What are Ably protocol adapters and how do they work?
1 parent 1a78ede commit 00a94b6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/pages/docs/protocols/index.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,20 @@ Seamlessly migrate from PubNub by connecting to the Ably network using the PubNu
7070

7171
Read more in the [PubNub Adapter section](/docs/protocols/pubnub).
7272

73+
## How protocol adapters work <a id="how-they-work"/>
74+
75+
The Ably platform is available at the endpoint `realtime.ably.io` for socket connections and `rest.ably.io` for REST-based requests and HTTP fallbacks for devices not supporting sockets. Ably client libraries always communicate directly with the Ably platform through those endpoints, and Ably ensures those endpoints route users to the closest available datacenter.
76+
77+
Protocol adapters use different endpoints from the default Ably endpoints and route users to a protocol adapter layer that also runs in each of our datacenters. For example, if a client uses MQTT, the endpoint is `mqtt.ably.io`. Ably's latency-based DNS ensures that the client connecting to `mqtt.ably.io` is routed to the closest datacenter, and when the routing layer receives the request, it identifies which protocol the request is destined for based on the hostname. The router then routes the request to a local frontend designed to process data for that protocol.
78+
79+
Protocol adapters run as middleware between the routers and the rest of the Ably service, ensuring that all incoming requests are transformed into the Ably protocol and sent to the Ably service, and all data received from Ably is transformed back to the client's protocol. The adapters are stateful, maintaining connections similar to how Ably provides connection state recovery. The routers ensure that requests are routed to the correct adapter handling each connection for each request.
80+
81+
Protocol adapters provide a seamless way to connect using different protocols to Ably without having to worry about the complexities of ensuring interoperability between protocols.
82+
83+
## Pricing <a id="pricing"/>
84+
85+
Use of protocol adapters carries no additional charge. You are charged for the total number of peak connections and messages sent as if you were using Ably's native protocol. See the [pricing](/docs/platform/pricing) page for more details.
86+
7387
## Getting started with protocol adapters <a id="getting-started"/>
7488

7589
If you are interested in using our protocol adapters to assist with migration from another service, or would like to use another protocol not listed here with Ably, then please [get in touch](https://ably.com/contact).

0 commit comments

Comments
 (0)