From aa54243628fcc390907e1faeed484d2ab3f694bd Mon Sep 17 00:00:00 2001 From: Francis Roberts <111994975+franrob-projects@users.noreply.github.com> Date: Tue, 23 Dec 2025 16:56:18 +0000 Subject: [PATCH] Adds USPs to livesync docs --- src/pages/docs/livesync/index.mdx | 12 ++++++++++++ src/pages/docs/livesync/mongodb/index.mdx | 12 ++++++++++++ src/pages/docs/livesync/postgres/index.mdx | 8 ++++++++ src/pages/docs/livesync/postgres/models.mdx | 8 ++++++++ 4 files changed, 40 insertions(+) diff --git a/src/pages/docs/livesync/index.mdx b/src/pages/docs/livesync/index.mdx index 8b145df32f..c4adf2772a 100644 --- a/src/pages/docs/livesync/index.mdx +++ b/src/pages/docs/livesync/index.mdx @@ -9,6 +9,10 @@ LiveSync is a powerful realtime data synchronization product designed to facilit LiveSync can be used in applications where your database is the source of truth for the application state, and that state needs to be reflected in realtime to client applications. LiveSync enables this data synchronisation while maintaining data integrity and low latency. + + ![What is LiveSync](../../../images/content/diagrams/what-is-livesync.png) By using Ably Pub/Sub [channels](https://ably.com/solutions/channels) and [SDKs](/docs/sdks), clients subscribing to messages published by a LiveSync database connector benefit from features like [connection-recovery](/docs/connect/states), [exactly-once delivery](/docs/platform/architecture) and [ordering guarantees](https://faqs.ably.com/reliable-message-ordering-for-connected-clients) out of the box. Ably's platform guarantees and [four pillars of dependability](https://ably.com/four-pillars-of-dependability) apply by default. @@ -17,6 +21,10 @@ By using Ably Pub/Sub [channels](https://ably.com/solutions/channels) and [SDKs] Ably's [pub/sub channels](/docs/channels) are the mechanism used by LiveSync for synchronizing data updates across clients. When a message is published on a channel by the database connector, it is immediately broadcast to all subscribers of that channel. + + ## Hosted database connectors Take advantage of the Ably hosted database connectors to automatically publish changes from your database as messages on Ably channels. The hosted database connectors support controlling which events are routed to which channels, and using Ably's [Auth](/docs/auth) and [Capabilities](/docs/auth/capabilities) you can control which channels a client is allowed to access. @@ -29,6 +37,10 @@ Ably provides hosted connectors for: LiveSync can benefit a wide range of applications where it's important to broadcast database changes in realtime to keep clients in sync, including: Customer Relationship Management (CRM) applications, customer support applications, productivity or task management applications, online auctions, collaborative form editing, e-commerce systems, chat conversations, multiplayer turn-based games and realtime newsfeeds. + + ## Pricing LiveSync [pricing](https://ably.com/pricing) is mainly based on message consumption (alongside concurrent connections and concurrent channels). This means that each update published from the database connector to Ably channels is counted as a single message. The message is received by every client subscribed to that channel, each of which counts as one additional message. If, for example, one update is published by the database connector and there are three clients subscribed, that one update will result in four messages in total. diff --git a/src/pages/docs/livesync/mongodb/index.mdx b/src/pages/docs/livesync/mongodb/index.mdx index 2939fb868a..622746e935 100644 --- a/src/pages/docs/livesync/mongodb/index.mdx +++ b/src/pages/docs/livesync/mongodb/index.mdx @@ -10,12 +10,20 @@ The MongoDB database connector utilizes the MongoDB [change streams](https://www By using Ably Pub/Sub channels and SDKs, clients subscribing to messages published by the MongoDB database connector benefit from features like [connection-recovery](/docs/connect/states), [exactly-once delivery](/docs/achieving-exactly-once-message-processing-with-ably) and [ordering guarantees](https://faqs.ably.com/reliable-message-ordering-for-connected-clients) out of the box. + + ![What is MongoDB database connector](../../../../images/content/diagrams/ably-connector-for-mongodb.png) ## How it works The MongoDB database connector is enabled through an Ably integration rule. The rule will consume document changes from your MongoDB deployment via the MongoDB [Change Streams API](https://www.mongodb.com/docs/manual/changeStreams/). The integration rule exists as a "database connector" component that is entirely provisioned and managed by Ably and is fault-tolerant with automatic fail-over. + + When a change event is received over the Change Streams API it is published to an Ably channel. When you configure the integration rule, you can specify how change events are mapped to individual Ably channels. Clients can then subscribe to database changes by subscribing to Ably channels. Ably [Auth](/docs/auth) and [Capabilities](/docs/auth/capabilities) control which channels a client can interact with. ## Integration rule @@ -153,6 +161,10 @@ For the schema and fields available on a change event, see the [MongoDB Change E You must set the `_ablyChannel` field on the root of the change event. This allows the MongoDB database connector to know where to route the change event. + + ### Dynamically route change events diff --git a/src/pages/docs/livesync/postgres/index.mdx b/src/pages/docs/livesync/postgres/index.mdx index 5567b410f9..fae6a5bd97 100644 --- a/src/pages/docs/livesync/postgres/index.mdx +++ b/src/pages/docs/livesync/postgres/index.mdx @@ -20,8 +20,16 @@ When your backend server processes a request to update data in your database, it By using the outbox table, you can specify which channel that record should be published to, and make changes to your other database tables transactionally with the publish. This mitigates the problem of trying to transactionally write to two different systems; Ably and the database. You can gain exactly-once and in-order delivery over Ably transactionally with other data you modify in your database. + + The Postgres database connector automatically retries failed publishes while maintaining ordering of messages on each channel. + + The database connector can be [self-hosted](#self-host). ## Integration rule diff --git a/src/pages/docs/livesync/postgres/models.mdx b/src/pages/docs/livesync/postgres/models.mdx index 0801e0391a..ce2075d08e 100644 --- a/src/pages/docs/livesync/postgres/models.mdx +++ b/src/pages/docs/livesync/postgres/models.mdx @@ -18,6 +18,10 @@ When creating a new `model` using the Models SDK you provide two functions to th - the [`sync()`](#sync) function is used by the SDK to retrieve the current state of the `model` from your backend, - the [`merge()`](#merge) function is used by the SDK to merge state change events published by the Postgres database connector with the existing frontend state in the `model`. + + The following diagram provides a simplified overview of the Models SDK: ![A flow diagram showing how all of the livesync models components tie in together](../../../../images/content/diagrams/livesync-models-components.png) @@ -116,6 +120,10 @@ const model = modelsClient.models.get({ ``` + + ## Sync function The sync function is used by the Models SDK to fetch the latest data from your backend. The SDK will automatically call this function when it is initialized, and when the SDK detects that the latest data is no longer available on the Ably channel.