-
Notifications
You must be signed in to change notification settings - Fork 46
[DX-883] Addresses message billing docs gap #3234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
umair-ably
wants to merge
8
commits into
main
Choose a base branch
from
DX-883-message-billing
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2d88327
Addresses message billing docs gap
umair-ably 6455152
separates Chat and pubsub billing concerns
umair-ably 7f70423
Centralise message billing into platform pricing and add product-spec…
umair-ably 2f73d77
Expand central message-counting page with all products and detailed o…
umair-ably 23c3006
Add product-specific pricing pages for Spaces and LiveObjects
umair-ably b7383f4
Expand Chat and Pub/Sub pricing pages with operations tables and opti…
umair-ably ca5e148
Update navigation to include product pricing pages
umair-ably ae14b42
Address PR comments inc. adding pricing pages for AI Transport and Li…
umair-ably File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,6 +57,10 @@ export default { | |
| }, | ||
| ], | ||
| }, | ||
| { | ||
| name: 'Spaces pricing', | ||
| link: '/docs/spaces/pricing', | ||
| }, | ||
| ], | ||
| api: [ | ||
| { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| --- | ||
| title: "AI Transport pricing" | ||
| meta_description: "Understand how AI Transport token streaming contributes to your message count, including per-token and per-response patterns." | ||
| meta_keywords: "AI Transport pricing, message counting, token streaming, message per response, message per token" | ||
| intro: "How AI Transport operations contribute to your message count and strategies to optimize costs." | ||
| --- | ||
|
|
||
| [AI Transport](/docs/ai-transport) uses standard Pub/Sub messaging. Each token or message published to Ably counts as an inbound message, and each delivery to a subscriber counts as an outbound message. | ||
|
|
||
| ## AI Transport operations <a id="operations"/> | ||
|
|
||
| The following table shows how AI Transport operations contribute to your message count: | ||
|
|
||
| | Operation | Messages counted | | ||
| | --- | --- | | ||
| | Token publish (per-token) | 1 inbound message per token | | ||
| | Token publish (per-response with [append rollup](/docs/ai-transport/token-streaming/token-rate-limits#per-response)) | Multiple tokens conflated into fewer inbound messages | | ||
| | Token delivery | 1 outbound message per subscriber | | ||
| | [Persistence](/docs/storage-history/storage) storage | 1 additional message per stored message | | ||
|
|
||
| The total cost depends on the [token streaming pattern](/docs/ai-transport/token-streaming#token-streaming-patterns) you choose. With per-token streaming, each token is a separate inbound message. With [message-per-response](/docs/ai-transport/token-streaming/message-per-response), append rollup conflates multiple tokens into fewer inbound messages, reducing costs. For example, 300 tokens can be conflated to approximately 100 inbound messages. | ||
|
|
||
| <Aside data-type="further-reading"> | ||
| For how all Ably products count messages, see [message counting](/docs/platform/pricing/message-counting). | ||
| </Aside> | ||
|
|
||
| ## Channels and connections <a id="channels-connections"/> | ||
|
|
||
| Each channel used for token streaming contributes to your [channel count](/docs/platform/pricing#channels). Ably bills each connected client for [connection minutes](/docs/platform/pricing#connections) per minute of connection time. | ||
|
|
||
| ## Cost optimization <a id="optimization"/> | ||
|
|
||
| ### Use message-per-response streaming | ||
|
|
||
| The [message-per-response](/docs/ai-transport/token-streaming/message-per-response) pattern with [append rollup](/docs/ai-transport/token-streaming/token-rate-limits#per-response) conflates multiple tokens into fewer inbound messages, significantly reducing costs compared to per-token streaming. | ||
|
|
||
| ### Use ephemeral messages | ||
|
|
||
| Mark messages as [ephemeral](/docs/pub-sub/advanced#ephemeral) to exempt them from persistence, rewind, resume, and integrations. Use this for streaming tokens where history is not needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,72 @@ | ||||||
| --- | ||||||
| title: "Chat pricing" | ||||||
| meta_description: "Understand how Chat SDK features contribute to your message count, including messages, typing indicators, reactions, and cost optimization strategies." | ||||||
| meta_keywords: "chat pricing, message counting, typing indicators, reactions, cost optimization" | ||||||
| intro: "How Chat SDK features contribute to your message count and strategies to optimize costs." | ||||||
| --- | ||||||
|
|
||||||
| The [Chat SDK](/docs/chat) is built on top of [Pub/Sub](/docs/pub-sub). All Chat operations generate Pub/Sub messages that follow the same counting rules. | ||||||
|
|
||||||
| ## Chat operations <a id="operations"/> | ||||||
|
|
||||||
| The following table shows how Chat operations contribute to your message count: | ||||||
|
|
||||||
| | Operation | Messages counted | | ||||||
| | --- | --- | | ||||||
| | [Messages](/docs/chat/rooms/messages) || | ||||||
| | Send message | 1 inbound message | | ||||||
| | Message delivery | 1 outbound message per subscriber | | ||||||
| | Update message | 1 inbound message | | ||||||
| | Message update delivery | 1 outbound message per subscriber | | ||||||
| | Delete message | 1 inbound message | | ||||||
| | Message deletion delivery | 1 outbound message per subscriber | | ||||||
| | [History](/docs/chat/rooms/history) retrieval | 1 message per retrieved message | | ||||||
| | [Typing indicators](/docs/chat/rooms/typing) || | ||||||
| | Typing keystroke | 1 inbound message; repeats every heartbeat interval (default 10s) | | ||||||
| | Typing indicator delivery | 1 outbound message per subscriber per heartbeat | | ||||||
| | Typing stop | 1 inbound message | | ||||||
| | Typing stop delivery | 1 outbound message per subscriber | | ||||||
| | [Reactions](/docs/chat/rooms/reactions) || | ||||||
| | Room reaction | 1 inbound message | | ||||||
| | Room reaction delivery | 1 outbound message per subscriber | | ||||||
| | [Message reaction](/docs/chat/rooms/message-reactions) send | 1 inbound message | | ||||||
| | [Message reaction](/docs/chat/rooms/message-reactions) delete | 1 inbound message | | ||||||
| | Message reaction summary delivery | 1 outbound message per subscriber; multiple reactions may be rolled up into a single summary | | ||||||
| | [Presence](/docs/chat/rooms/presence) and [occupancy](/docs/chat/rooms/occupancy) || | ||||||
| | Presence enter | 1 inbound message | | ||||||
| | Presence leave | 1 inbound message | | ||||||
| | Presence update | 1 inbound message | | ||||||
| | Presence event delivery | 1 outbound message per presence subscriber | | ||||||
| | Occupancy event | 1 outbound message per subscriber (generated on membership changes, debounced up to 15s) | | ||||||
| | [Moderation](/docs/chat/moderation) || | ||||||
| | Moderation action | 1 inbound message; triggers a message update or delete which follows standard delivery | | ||||||
|
|
||||||
| <Aside data-type="further-reading"> | ||||||
| For how all Ably products count messages, see [message counting](/docs/platform/pricing/message-counting). | ||||||
| </Aside> | ||||||
|
|
||||||
| ## Rooms, channels, and connections <a id="rooms-connections"/> | ||||||
|
|
||||||
| Each Chat room maps to a set of underlying Pub/Sub channels. Each room feature (messages, typing, reactions, presence, occupancy) uses its own dedicated channel. The total number of channels used by a room depends on which features are active. | ||||||
|
|
||||||
| Channels contribute to your [channel count](/docs/platform/pricing#channels). The more rooms a client is attached to, and the more features enabled per room, the more channels are consumed. | ||||||
|
|
||||||
| Ably bills each connected client for [connection minutes](/docs/platform/pricing#connections). Ably counts a connection-minute for every minute a client maintains an open connection, regardless of activity. Clients that remain connected but idle still accrue connection minutes. | ||||||
|
|
||||||
| ## Cost optimization <a id="optimization"/> | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it worth adding some quick info on detaching from rooms and closing connections? |
||||||
|
|
||||||
| ### Reduce typing indicator frequency | ||||||
|
|
||||||
| Increase the `heartbeatThrottleMs` [room option](/docs/chat/rooms#typing) to reduce typing indicator event frequency. The default is 10 seconds. Increase this value in rooms that tolerate delayed typing feedback. | ||||||
|
|
||||||
| ### Use server-side batching | ||||||
|
|
||||||
| [Server-side batching](/docs/messages/batch#server-side) groups messages into single deliveries. Use this for high-throughput rooms where slight delay is acceptable. | ||||||
|
|
||||||
| ### Detach from unused rooms | ||||||
|
|
||||||
| [Detach](/docs/chat/rooms#detach) from rooms when they are no longer needed, and [release](/docs/chat/rooms#release) rooms that are no longer in use. This reduces your channel count and connection usage. Close connections when the client is done to stop accruing connection minutes. | ||||||
|
|
||||||
| ### Use occupancy instead of presence | ||||||
|
|
||||||
| Use [occupancy](/docs/chat/rooms/occupancy) instead of [presence](/docs/chat/rooms/presence) when you only need member counts, not individual identities. This avoids the n-squared presence event fan-out. For example, 200 members joining and leaving generates approximately **80,400 messages**. See [large-scale presence sets](/docs/presence-occupancy/presence#large-presence) for details. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest something like this format, to make the tables more readable and have fewer repeated links: