Skip to content

Commit 031b0df

Browse files
committed
Centralise message billing into platform pricing and add product-specific pricing pages
1 parent b791f38 commit 031b0df

File tree

7 files changed

+133
-77
lines changed

7 files changed

+133
-77
lines changed

src/data/nav/chat.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ export default {
220220
],
221221
},
222222
{
223-
name: 'Message billing',
224-
link: '/docs/chat/message-billing',
223+
name: 'Pricing',
224+
link: '/docs/chat/pricing',
225225
},
226226
{
227227
name: 'Guides',

src/data/nav/platform.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ export default {
125125
link: '/docs/platform/pricing/billing',
126126
name: 'Billing',
127127
},
128+
{
129+
link: '/docs/platform/pricing/message-billing',
130+
name: 'Message billing',
131+
},
128132
{
129133
link: '/docs/platform/pricing/limits',
130134
name: 'Limits',

src/data/nav/pubsub.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,8 @@ export default {
335335
],
336336
},
337337
{
338-
name: 'Message billing',
339-
link: '/docs/pub-sub/message-billing',
338+
name: 'Pricing',
339+
link: '/docs/pub-sub/pricing',
340340
},
341341
{
342342
name: 'Guides',

src/pages/docs/chat/message-billing.mdx

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/pages/docs/chat/pricing.mdx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: "Pricing"
3+
meta_description: "Understand how Chat SDK features contribute to your message count, including messages, typing indicators, reactions, and cost optimization strategies."
4+
meta_keywords: "chat billing, message counting, typing indicators, reactions, chat pricing, cost optimization"
5+
intro: "How Chat SDK features contribute to your message count and strategies to optimize costs."
6+
redirect_from:
7+
- /docs/chat/message-billing
8+
---
9+
10+
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 billing rules.
11+
12+
<Aside data-type="further-reading">
13+
For the complete reference on how all Ably operations count as messages, see [message billing](/docs/platform/pricing/message-billing). For package comparison and volume discounts, see the [pricing](https://ably.com/pricing) page.
14+
</Aside>
15+
16+
## What counts as a message <a id="messages"/>
17+
18+
Each Chat feature generates Pub/Sub messages. For example, 1 message sent in a room with 50 subscribers counts as **51 messages** (1 inbound + 50 outbound). Typing indicators are the most significant cost driver. In a room with 50 subscribers, one active typer generates approximately **306 messages per minute** from heartbeat events alone, plus a stop event.
19+
20+
For the complete breakdown of how each Chat operation counts as messages, see the [Chat operations](/docs/platform/pricing/message-billing#chat-operations) table in the central message billing reference.
21+
22+
## Channels and connection minutes <a id="channels-connections"/>
23+
24+
Chat rooms map directly to Pub/Sub channels. Each room feature (messages, typing, reactions, presence, occupancy) uses underlying Pub/Sub channels. Ably bills each connected client for [connection minutes](/docs/platform/pricing#connections) in the same way as Pub/Sub.
25+
26+
## Cost optimization strategies <a id="optimization"/>
27+
28+
The following strategies reduce Chat message costs:
29+
30+
| Strategy | How it reduces costs |
31+
| --- | --- |
32+
| Increase `heartbeatThrottleMs` | Reduces typing indicator event frequency |
33+
| Disable typing indicators | Eliminates typing indicator messages in rooms where they are not needed |
34+
| [Server-side batching](/docs/guides/pub-sub/data-streaming#solution-server-side-batching) | Groups messages into single deliveries |
35+
| [Occupancy](/docs/presence-occupancy/occupancy) instead of presence | Avoids n-squared presence event fan-out when you only need member counts |
36+
37+
<Aside data-type="further-reading">
38+
For the full list of message counting rules across all products, see [message billing](/docs/platform/pricing/message-billing).
39+
</Aside>
Lines changed: 45 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,42 @@
11
---
22
title: "Message billing"
3-
meta_description: "Understand how different Ably Pub/Sub operations contribute to your message count, including persistence, presence, and cost optimization strategies."
4-
meta_keywords: "message billing, message counting, pricing, persistence billing, presence billing, cost optimization"
3+
meta_description: "Understand how operations across all Ably products contribute to your message count, including Pub/Sub, Chat, LiveObjects, and Annotations."
4+
meta_keywords: "message billing, message counting, pricing, Pub/Sub billing, Chat billing, LiveObjects billing"
5+
intro: "How operations across all Ably products contribute to your message count."
56
---
67

7-
This page explains how different Ably operations contribute to your message count. Understanding message billing helps you optimize costs and choose the right features for your use case.
8+
All Ably products count messages for billing purposes. The following sections explain how operations across Pub/Sub, Chat, LiveObjects, and Annotations contribute to your message count.
89

910
<Aside data-type="further-reading">
1011
For package comparison and volume discounts, see the [pricing](https://ably.com/pricing) page. For general billing information, see [billing](/docs/platform/pricing/billing).
1112
</Aside>
1213

13-
## Basic message counting <a id="basic-counting"/>
14+
## How messages are counted <a id="basic-counting"/>
1415

15-
Every message sent through Ably is counted for both publishing and delivery:
16+
Ably counts every message for both publishing and delivery:
1617

1718
* 1 publish = 1 inbound message
1819
* Each subscriber delivery = 1 outbound message per subscriber
1920
* Each integration delivery = 1 outbound message per [integration](/docs/platform/integrations) target
2021
* Messages from metachannels (such as `[meta]log` and `[meta]stats`) follow the same counting rules
2122

22-
For example, 1 publisher sends a message to a channel with 10 subscribers = **11 messages** (1 inbound + 10 outbound).
23+
For example, if 1 publisher sends a message to a channel with 10 subscribers, this counts as **11 messages** (1 inbound + 10 outbound).
2324

2425
## Message size <a id="message-size"/>
2526

26-
Message size for Pub/Sub messages is calculated as the sum of the `name`, `clientId`, `data`, and `extras` [properties](/docs/api/realtime-sdk/messages#properties) before any compression or expansion occurs in the serialization process.
27-
28-
<Aside data-type="note">
29-
LiveObjects and Annotations have different billing considerations. See [LiveObjects billing](/docs/liveobjects/concepts/billing) and [Annotations](/docs/messages/annotations) for details on their respective billing.
30-
</Aside>
27+
Ably calculates message size for Pub/Sub messages as the sum of the `name`, `clientId`, `data`, and `extras` [properties](/docs/api/realtime-sdk/messages#properties) before any compression or expansion occurs in the serialization process.
3128

3229
* `name` and `clientId` are calculated as the size in bytes of their UTF-8 representation.
3330
* `data` is calculated as the size in bytes if it is binary, or its UTF-8 byte length if it is a string.
3431
* `extras` is calculated as the string length of its JSON representation.
3532

36-
The [bandwidth](/docs/platform/pricing#bandwidth) allowance calculation uses an average message size of 5KiB. If your total bandwidth for the month exceeds this baseline, the overage is charged per GiB.
33+
The [bandwidth](/docs/platform/pricing#bandwidth) allowance calculation uses an average message size of 5KiB. If your total bandwidth for the month exceeds this baseline, Ably charges overage per GiB.
3734

3835
See [maximum message size](/docs/platform/pricing/limits#message) for the size limits per package type.
3936

40-
## Operations and their billing impact <a id="operations"/>
37+
## Pub/Sub operations <a id="pubsub-operations"/>
4138

42-
The following table shows how different operations contribute to your message count:
39+
The following table shows how Pub/Sub operations contribute to your message count:
4340

4441
| Operation | Messages counted | Notes |
4542
| --- | --- | --- |
@@ -51,21 +48,51 @@ The following table shows how different operations contribute to your message co
5148
| Rewind on attach | Rewound messages count as outbound | Up to 100 messages per [rewind](/docs/channels/options/rewind) |
5249
| Push notification | Counted separately per push platform | See [push notifications](/docs/push) |
5350

51+
For Pub/Sub-specific cost optimization strategies, see [Pub/Sub pricing](/docs/pub-sub/pricing).
52+
53+
## Chat operations <a id="chat-operations"/>
54+
55+
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.
56+
57+
| Operation | Messages counted | Notes |
58+
| --- | --- | --- |
59+
| Chat message | 1 inbound + 1 per subscriber outbound | Same as a standard publish |
60+
| Typing indicator heartbeat | 1 inbound + 1 per subscriber outbound | Default interval is 10 seconds; approximately 6 events per minute per active typer |
61+
| Typing indicator stop | 1 inbound + 1 per subscriber outbound | Sent when a user stops typing |
62+
| Room reaction | 1 inbound + 1 per subscriber outbound | Same as a standard publish |
63+
| Presence enter/leave/update | 1 inbound + 1 per presence subscriber outbound | Same as Pub/Sub presence |
64+
| Occupancy | Uses metachannels | Follows standard metachannel counting rules |
65+
66+
For Chat-specific cost optimization strategies, see [Chat pricing](/docs/chat/pricing).
67+
68+
## LiveObjects operations <a id="liveobjects-operations"/>
69+
70+
LiveObjects has a different billing scheme based on ObjectMessages. Each ObjectMessage counts as:
71+
72+
* 1 outbound message per connected client (delivery)
73+
* 1 inbound message per connected client (acknowledgment)
74+
75+
See the [LiveObjects billing](/docs/liveobjects/concepts/billing) page for details.
76+
77+
## Annotations <a id="annotations"/>
78+
79+
[Annotations](/docs/messages/annotations) have a different billing scheme from standard messages. See the [Annotations](/docs/messages/annotations) page for details on how annotation operations are counted.
80+
5481
## Persistence billing <a id="persistence"/>
5582

56-
When persistence is enabled via [channel rules](/docs/storage-history/storage), each message stored to disk counts as an additional message.
83+
When persistence is enabled via [channel rules](/docs/storage-history/storage), Ably counts each message stored to disk as an additional message.
5784

58-
If you persist all messages, a message published to 10 subscribers with persistence enabled = 1 (publish) + 10 (subscriber delivery) + 1 (persistence storage) = **12 messages**.
85+
If you persist all messages, a message published to 10 subscribers with persistence enabled counts as 1 (publish) + 10 (subscriber delivery) + 1 (persistence storage) = **12 messages**.
5986

60-
If you persist last message only, the most recent message is stored. The storage cost is 1 additional message per new "last message" stored.
87+
If you persist the last message only, Ably stores the most recent message. The storage cost is 1 additional message per new "last message" stored.
6188

6289
Retrieving persisted messages via the [history API](/docs/storage-history/history) also counts: each message returned in a history response = 1 additional message.
6390

6491
To avoid additional costs for messages that do not need persistence, history, rewind, integrations, or resume, mark them as [ephemeral](/docs/pub-sub/advanced#ephemeral). Ephemeral messages are exempt from all of these features, reducing your billable message count.
6592

6693
## Presence event billing <a id="presence"/>
6794

68-
Presence events (enter, leave, update) are billed as regular messages:
95+
Ably bills presence events (enter, leave, update) as regular messages:
6996

7097
* 1 presence enter event with 100 presence subscribers = **101 messages** (1 enter + 100 deliveries)
7198

@@ -79,19 +106,6 @@ To reduce presence costs:
79106
* Enable [server-side batching](/docs/presence-occupancy/presence#large-presence) to group presence events and support up to 20,000 members per channel.
80107
* Subscribe to presence updates only on channels where you need member-level detail.
81108

82-
## Cost optimization strategies <a id="optimization"/>
83-
84-
The following table summarizes strategies for reducing message costs:
85-
86-
| Strategy | How it reduces costs | When to use |
87-
| --- | --- | --- |
88-
| [Ephemeral messages](/docs/pub-sub/advanced#ephemeral) | Exempt from persistence, rewind, resume, and integrations | Streaming data where history is not needed |
89-
| [echoMessages: false](/docs/pub-sub/advanced#echo) | Prevents self-delivery to the publisher | Optimistic UI patterns and server-side publishers |
90-
| [Conflation](/docs/guides/pub-sub/data-streaming#solution-message-conflation) | Delivers only the latest message per key in each time window | High-frequency updates where only the latest value matters |
91-
| [Server-side batching](/docs/guides/pub-sub/data-streaming#solution-server-side-batching) | Groups messages into single deliveries | High-throughput channels where slight delay is acceptable |
92-
| [Delta compression](/docs/channels/options/deltas) | Reduces payload size, lowering bandwidth costs | Large, structurally similar successive messages |
93-
| [Occupancy](/docs/presence-occupancy/occupancy) instead of presence | Avoids n-squared presence event fan-out | When you need member counts, not individual identities |
94-
95109
<Aside data-type="further-reading">
96110
See the [pricing](https://ably.com/pricing) page for package comparison and volume discounts.
97111
</Aside>

src/pages/docs/pub-sub/pricing.mdx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: "Pricing"
3+
meta_description: "Understand how Pub/Sub operations contribute to your message count, including persistence, presence, and cost optimization strategies."
4+
meta_keywords: "message billing, message counting, pricing, persistence billing, presence billing, cost optimization"
5+
intro: "How Pub/Sub operations contribute to your message count and strategies to optimize costs."
6+
redirect_from:
7+
- /docs/pub-sub/message-billing
8+
---
9+
10+
Pub/Sub operations contribute to your message count based on publishing, delivery, and optional features like persistence and presence. The following sections explain how Ably counts these operations and how to optimize costs.
11+
12+
<Aside data-type="further-reading">
13+
For the complete reference on how all Ably operations count as messages, see [message billing](/docs/platform/pricing/message-billing). For package comparison and volume discounts, see the [pricing](https://ably.com/pricing) page.
14+
</Aside>
15+
16+
## What counts as a message <a id="messages"/>
17+
18+
Every message published through Pub/Sub counts as 1 inbound message, with each subscriber delivery counting as 1 outbound message. Optional features like persistence, history retrieval, and integrations generate additional messages.
19+
20+
For the complete breakdown of how each Pub/Sub operation counts as messages, see the [Pub/Sub operations](/docs/platform/pricing/message-billing#pubsub-operations) table in the central message billing reference.
21+
22+
## Channels and connection minutes <a id="channels-connections"/>
23+
24+
[Channels](/docs/channels) are the unit of message distribution. Each channel you use contributes to your [channel count](/docs/platform/pricing#channels). Ably bills [connection minutes](/docs/platform/pricing#connections) per minute of connection time for each connected client.
25+
26+
## Cost optimization strategies <a id="optimization"/>
27+
28+
The following table summarizes strategies for reducing message costs:
29+
30+
| Strategy | How it reduces costs | When to use |
31+
| --- | --- | --- |
32+
| [Ephemeral messages](/docs/pub-sub/advanced#ephemeral) | Exempt from persistence, rewind, resume, and integrations | Streaming data where history is not needed |
33+
| [echoMessages: false](/docs/pub-sub/advanced#echo) | Prevents self-delivery to the publisher | Optimistic UI patterns and server-side publishers |
34+
| [Conflation](/docs/guides/pub-sub/data-streaming#solution-message-conflation) | Delivers only the latest message per key in each time window | High-frequency updates where only the latest value matters |
35+
| [Server-side batching](/docs/guides/pub-sub/data-streaming#solution-server-side-batching) | Groups messages into single deliveries | High-throughput channels where slight delay is acceptable |
36+
| [Delta compression](/docs/channels/options/deltas) | Reduces payload size, lowering bandwidth costs | Large, structurally similar successive messages |
37+
| [Occupancy](/docs/presence-occupancy/occupancy) instead of presence | Avoids n-squared presence event fan-out | When you need member counts, not individual identities |
38+
39+
<Aside data-type="further-reading">
40+
For the full list of message counting rules across all products, see [message billing](/docs/platform/pricing/message-billing).
41+
</Aside>

0 commit comments

Comments
 (0)