Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 63 additions & 1 deletion src/pages/docs/protocols/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ Ably SDKs are the recommended method for connecting to Ably because they offer s

Protocol adapters offer an alternative method for connecting to Ably. The advantage to protocol adapters is that they require fewer resources in terms of memory and network overhead such as in smaller footprint devices, or on a platform where an Ably SDK isn't available such as an Arduino-based IoT wearable. The potential drawback to consider when evaluating protocol adapters is that they do not support the full set of Ably features, for example the MQTT protocol adapter does not support presence, and the SSE protocol adapter does not support automatic token renewal.

## Migration support <a id="migration-support"/>

Ably helps customers migrate from other data streaming networks including PubNub and Pusher. Protocol adapters facilitate risk-free migration by allowing you to use existing protocols and client libraries while transitioning to Ably client libraries over time.

Protocol adapters ensure interoperability between different protocols. For example, you can publish sensor data from an MQTT device, subscribe to that data using a Pusher client library for dashboard display, support mobile apps using Ably SDKs, and process data using AMQP worker queues - all within the same system.

Migration times typically range from a few hours (using protocol adapters) to a week, depending on your migration strategy and whether you choose to adopt Ably's native SDKs immediately or transition gradually.

A full list of Ably SDKs can be found on the [SDK page](/docs/sdks).

## Available Protocol Adapters <a id="available-adapters"/>
Expand All @@ -21,12 +29,13 @@ Ably supports multiple protocols in addition to the native WebSockets-based one:
* [STOMP](#stomp)
* [Pusher](#pusher)
* [PubNub](#pubnub)
* [Socket.IO migration](#socketio)

### MQTT <a id="mqtt"/>

MQTT (MQ Telemetry Transport) is a publish/subscribe, lightweight messaging protocol designed for constrained devices and low-bandwidth networks. One of the major uses of MQTT is with IoT (Internet of Things), where these principles are key to having effective communication between various devices.

MQTT can also be used with Ably as a basic event broker or if we don't have an SDK for your target platform. However, without an SDK you don't get access to the full range of platform features and data guarantees.
MQTT can also be used with Ably as a basic event broker or if an SDK is not available for your target platform. However, without an SDK you don't get access to the full range of platform features and data guarantees.

Read more in the [MQTT section](/docs/protocols/mqtt).

Expand Down Expand Up @@ -65,3 +74,56 @@ Ably is the only cloud vendor that supports the PubNub protocol. It's simple to
Seamlessly migrate from PubNub by connecting to the Ably network using the PubNub protocol.

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

### Socket.IO migration <a id="socketio"/>

Below is a guide to some of the basics of transitioning from Socket.io to Ably. The socket.io API is actually very similar to the Ably API.

#### To connect

In socketIO:
```javascript
io.on('connection', (socket) => {
console.log('a user connected');
});
```

In Ably:
```javascript
ably.connection.on('connected', function() {
alert("Connected to Ably in realtime");
});
```

#### Sending a message:

In SocketIO:
```javascript
io.on('connection', (socket) => {
socket.broadcast.emit('message-name', 'hello there this is my message');
});
```

In Ably, you need to first have a channel set up and then you can send and receive on that channel:
```javascript
var channel = ably.channels.get('test-channel');
channel.publish('message-name', 'hello there this is my message');
```

#### To receive a message:

In SocketIO:
```javascript
socket.on('message-name', (message) => {
console.log('message was: ' + message);
});
```

In Ably any subscribers to the channel that you created will receive the message:
```javascript
channel.subscribe('test-channel', function(message) {
console.log('message was: ' + message.data);
});
```

For more help, please [get in touch](https://ably.com/contact).
14 changes: 14 additions & 0 deletions src/pages/docs/protocols/pubnub.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ Many of the advantages associated with using Ably, such as the use of WebSockets

You can use PuBNub and and an Ably SDK side-by-side as they are interoperable, with the exception of a few features.

For a detailed comparison of Ably and PubNub features, see [Ably vs PubNub](https://ably.com/compare/ably-vs-pubnub).

## Migration process <a id="migration-process"/>

A typical migration from PubNub to Ably follows these steps:

1. Change the host name for all of your PubNub client library integrations to use Ably's endpoints.

2. Migrate one app at a time over to Ably client libraries. At this stage, some of your apps will be using PubNub client libraries and others will be using Ably's client libraries. Since the adapter translates the PubNub protocol, there's no interruption and interoperability between both protocols is maintained.

3. Migrate all your apps and servers to use Ably client libraries and terminate your old contracts.

If you're interested in migrating from PubNub using protocol adapters, [get in touch](https://ably.com/contact).

## Supported features <a id="features"/>

The following PubNub features are supported using the adapter:
Expand Down
4 changes: 3 additions & 1 deletion src/pages/docs/protocols/pusher.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ languages:
- javascript
---

Ably enables migration from Pusher to Ably using its Pusher Adapter. The protocol adapter handles all background translation and only requires an API key change.
Ably enables migration from Pusher to Ably using its Pusher Adapter. The protocol adapter handles all background translation and only requires an API key change, allowing you to use existing Pusher client libraries directly with Ably.

Using an adapter introduces some latency and is slower than using an Ably SDK, however the impact is typically in the low milliseconds. It will also be slightly slower than using Pusher natively, but only if you are close to whichever Pusher data center used. If you aren't close to the Pusher data center you've chosen, then the extra latency from using the adapter should be more than compensated for by being able to use a data center that is close to you. This is because Ably automatically connects clients to the data center closest to them.

The Pusher Adapter provides some of the advantages of Ably, such as inter-regional message federation, however others, such as [continuity guarantees](https://ably.com/four-pillars-of-dependability), fallback host support, and [message history](/docs/storage-history/history) are only available when using an Ably SDK. If an [Ably SDK](/docs/sdks) is available in your chosen platform, it is recommended you use that, or plan to transition to it eventually.

For a detailed comparison of Ably and Pusher features, see [Ably vs Pusher](https://ably.com/compare/ably-vs-pusher).

## Supported features <a id="features"/>

The following Pusher features are supported using the adapter:
Expand Down