Skip to content

Data streaming and distrobution use case guide#2979

Merged
splindsay-92 merged 27 commits intomainfrom
chat/data-streaming-and-distrobution-use-case-guide
Feb 6, 2026
Merged

Data streaming and distrobution use case guide#2979
splindsay-92 merged 27 commits intomainfrom
chat/data-streaming-and-distrobution-use-case-guide

Conversation

@splindsay-92
Copy link
Contributor

@splindsay-92 splindsay-92 commented Nov 25, 2025

Description

Added a pubsub guide that focus on data streaming and distrobution, with a focus on conflation, deltas and server-side batching.

FF-164

TODO: There are a few diagrams/images that might be useful, I will ask design once we are happy with the content.

Checklist

@coderabbitai
Copy link

coderabbitai bot commented Nov 25, 2025

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chat/data-streaming-and-distrobution-use-case-guide

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@splindsay-92 splindsay-92 requested a review from a team November 28, 2025 10:10
@splindsay-92 splindsay-92 force-pushed the chat/data-streaming-and-distrobution-use-case-guide branch from 74a56b6 to 6881afb Compare November 28, 2025 10:10
@splindsay-92 splindsay-92 added the review-app Create a Heroku review app label Nov 28, 2025
@ably-ci ably-ci temporarily deployed to ably-docs-chat-data-str-ccunkm November 28, 2025 10:13 Inactive
@m-hulbert m-hulbert requested a review from AndyTWF November 28, 2025 10:19
@splindsay-92 splindsay-92 changed the title chat/data-streaming-and-distrobution-use-case-guide Data streaming and distrobution use case guide Dec 1, 2025
@splindsay-92 splindsay-92 marked this pull request as ready for review December 3, 2025 15:08
* **Producer simplicity:** Publishers send complete state; Ably handles the optimization
* **Lossless updates:** Subscribers still receive every update, just in a more efficient format

[//]: # (Think it could be good to have some kind of visiual showing full message vs delta message size comparison so its not just walls of text)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes 100% need visuals

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we get the visual?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet, I have a bunch of visuals that I'm going to request so I'll make sure they all get added. Some may be after merging though.

* **Cost efficiency:** Fewer outbound messages reduce billable message counts
* **Granular control:** Publish rates can differ across conflation groups, but still be conflated on the same channel.

[//]: # (Could be good here to have another visual showing messages published at mixed rates with differing conflation keys being conflated into a single batch message)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@splindsay-92 splindsay-92 force-pushed the chat/data-streaming-and-distrobution-use-case-guide branch 2 times, most recently from 193888b to cf51f30 Compare December 9, 2025 16:27
@AndyTWF AndyTWF added review-app Create a Heroku review app and removed review-app Create a Heroku review app labels Dec 11, 2025
@ably-ci ably-ci temporarily deployed to ably-docs-chat-data-str-bckufm December 11, 2025 12:40 Inactive
Copy link
Contributor

@AndyTWF AndyTWF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good start - I think we can do a bit more to call out Ably's USPs, what makes us distinct in the way we handle these tough problems (e.g. computing deltas server-side)?

* **Producer simplicity:** Publishers send complete state; Ably handles the optimization
* **Lossless updates:** Subscribers still receive every update, just in a more efficient format

[//]: # (Think it could be good to have some kind of visiual showing full message vs delta message size comparison so its not just walls of text)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes 100% need visuals

How you structure channels significantly impacts performance, costs, and scalability:

**Single channel with many subscribers:**
This is the most common pattern for data streaming, and is recommended in most use-cases. Ably uses [consistent hashing](/docs/platform/architecture/platform-scalability) to distribute channel load across instances, enabling you to fan out to millions of subscribers on a single channel:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consistent hashing is more about balancing inbound message load, rather than the fanout.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarified this, and mentioned we have a separate connection layer that can scale independently from the cores. 5f18fcd


Once conflation is configured as a channel rule, no consumer code changes are needed. Subscribers receive conflated updates transparently:

<Code>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto re more client-side languages

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ably-ci ably-ci temporarily deployed to ably-docs-chat-data-str-bckufm December 11, 2025 17:53 Inactive
@ably-ci ably-ci temporarily deployed to ably-docs-chat-data-str-bckufm December 12, 2025 13:30 Inactive
Copy link
Contributor

@m-hulbert m-hulbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really great! I've mostly left minor comments throughout and then 2 asks on formatting:

  • There's some odd linting putting a line break after every sentence or piece of punctuation.
  • There's a lot of bold in use - especially in the lists. Can we pare this back a bit to only highlight critical or really important info please.

- **IoT sensor networks:** Aggregating and distributing data from thousands of sensors across industrial facilities, smart cities, or environmental monitoring systems.
- **Live event platforms:** Managing reactions, chat, and activity feeds during concerts, conferences, or sporting events with thousands of simultaneous participants.
- **Fleet and asset tracking:** Real-time position and status updates for vehicles, equipment, or goods in logistics and supply chain applications.
- **Collaborative applications:** Synchronizing state and updates across users in shared documents, design tools, or gaming environments.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually disagree with the previous suggestion of mixing a Spaces use case into a Pub/Sub guide.

Copy link
Contributor Author

@splindsay-92 splindsay-92 Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does feel like there is some crossover here, state sync for things like match state is very much a pubsub use-case, but I'll have a think and might just remove it.

Edit: I removed it for now.


## How do I reduce bandwidth and latency when data changes frequently but incrementally?

**The challenge:** A sports games platform streams live match state to spectators and players as matches progress. The match state naturally grows throughout the game - starting with basic match info, then accumulating player statistics, scores, game events, and other statistics. By mid-game, the full state can be many kilobytes. Publishing the entire state with each update means transmitting increasingly large payloads repeatedly to every spectator, even though only small portions change between updates (a player's ranking shifts, a score increment or some game metric updates). This wastes massive bandwidth on redundant information, especially as the match state grows larger.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest removing the bold emphasis on the 'problem' and 'what's needed' and just introducing the separate paragraps using words, e.g.

"An example of frequent, incremental state change is found in sports games platforms..."

Comment on lines 703 to 662
**Realtime vs REST for publishing:**
Choose the appropriate client type based on your publisher characteristics:
- **Use Realtime SDK** when:
- Publishing messages at a very high volume.
- Need the lowest possible latency.
- Need bidirectional communication (publish and subscribe).
- Ordering of published messages is critical.

- **Use REST API** when:
- You have stateless publishers (e.g., serverless functions).
- Publishing from environments where maintaining persistent connections is impractical.
- Publishing from some authoritative backend server, or on behalf of multiple users.
- Batch publishing many messages to different channels in a single API call.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is quite generic advice on REST vs realtime - is there anything we should recommend specifially for these use cases here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could just remove this I suppose? The use-cases are more focused on the stream/outbound clients and I've not really discussed publisher characteristics (which could probably be a guide in and of itself), what do you think?


### Platform capabilities

Ably's architecture provides built-in guarantees:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this any different or rather more info in respect to the 4 pillars section?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There wasn't, so I've removed it :)

* Choose appropriate optimization strategy for each channel or namespace.
* Monitor statistics to validate configuration choices, start conservatively.
* Test client applications to ensure they handle any added latency or batching behavior.
* Review [platform limits](/docs/platform/pricing/limits) for your account tier.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should exclude this as theoretically this should be hard to hit for the majority of customers.

@splindsay-92 splindsay-92 force-pushed the chat/data-streaming-and-distrobution-use-case-guide branch from 682ec4c to 151751f Compare December 22, 2025 13:24
@splindsay-92
Copy link
Contributor Author

This is really great! I've mostly left minor comments throughout and then 2 asks on formatting:

  • There's some odd linting putting a line break after every sentence or piece of punctuation.
  • There's a lot of bold in use - especially in the lists. Can we pare this back a bit to only highlight critical or really important info please.

I've corrected the linting, seems my local was misconfigured.

I've cut down the number of lists/use of bold - if it's still too much, I can do another round of culling

@splindsay-92 splindsay-92 force-pushed the chat/data-streaming-and-distrobution-use-case-guide branch from 7eed2db to a8e78f1 Compare January 7, 2026 17:40
@splindsay-92 splindsay-92 force-pushed the chat/data-streaming-and-distrobution-use-case-guide branch from a8e78f1 to f7089a1 Compare January 20, 2026 17:24
@splindsay-92 splindsay-92 requested a review from AndyTWF January 21, 2026 09:09
@splindsay-92 splindsay-92 force-pushed the chat/data-streaming-and-distrobution-use-case-guide branch from f7089a1 to b044538 Compare January 21, 2026 09:09
- The optimization works transparently without code changes for producers or consumers
- Creates predictable billing that scales linearly with user count rather than message volume

[//]: # (Again, might be good to get a diagram or somethign in here so it feels less like a wall of text..)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Design have a diagram for SSB I'm pretty sure

Copy link
Contributor

@AndyTWF AndyTWF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy with the technical solutions proposed here - will leave it to the folks in DevEd to cover the typography

@splindsay-92 splindsay-92 force-pushed the chat/data-streaming-and-distrobution-use-case-guide branch from cc54037 to 28ce9a7 Compare February 6, 2026 17:11
@splindsay-92 splindsay-92 enabled auto-merge (squash) February 6, 2026 17:15
@splindsay-92 splindsay-92 merged commit 2b128eb into main Feb 6, 2026
7 checks passed
@splindsay-92 splindsay-92 deleted the chat/data-streaming-and-distrobution-use-case-guide branch February 6, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-app Create a Heroku review app

Development

Successfully merging this pull request may close these issues.

6 participants