You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update LiveObjects docs for aggregate limits and notification mode
- Clarify that the 6.5 MB object size limit is an aggregate across
all objects on a channel, with no limit on object count
- Document the 64 KiB per-operation size constraint and that objects
can grow beyond it via incremental updates
- Note that large objects may be split across multiple sync messages,
affecting billing message counts
- Add documentation for the new 'notification' inband objects mode,
which sends a REST API link instead of streaming full state
- Restructure inband-objects.mdx into 'objects mode' and
'notification mode' sections
- Fix limits.mdx description to say "aggregate size of all objects"
Copy file name to clipboardExpand all lines: src/pages/docs/channels/options/index.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -430,7 +430,7 @@ Occupancy events have a payload in the `data` property with a value of `occupanc
430
430
431
431
### Inband Objects <aid="objects"/>
432
432
433
-
[Inband objects](/docs/liveobjects/inband-objects) allows clients to subscribe to changes to [LiveObjects](/docs/liveobjects) channel objects as regular channel messages.
433
+
[Inband objects](/docs/liveobjects/inband-objects) allows clients to subscribe to changes to [LiveObjects](/docs/liveobjects) channel objects as regular channel messages. Set the `objects` channel parameter to `'objects'` to stream the full state, or `'notification'` to receive change notifications.
434
434
435
435
When using inband objects, the client receives messages with the special name `[meta]objects` that describe the current set of objects on a channel.
During initial synchronization and resynchronization, each object on the channel is sent as a message.
160
+
During initial synchronization and resynchronization, each object on the channel is sent as one or more messages. Large objects, such as maps with many entries, may be split across multiple messages.
161
161
162
-
For example, if a channel contains 10 objects (such as `LiveMap` and `LiveCounter` instances), a client attaching to the channel will receive 10 messages during synchronization.
162
+
For example, if a channel contains 10 objects (such as `LiveMap` and `LiveCounter` instances), a client attaching to the channel will receive at least 10 messages during synchronization.
163
163
164
164
Similarly, if a client becomes disconnected and needs to resynchronize, it will receive messages for each object that needs to be synchronized.
Copy file name to clipboardExpand all lines: src/pages/docs/liveobjects/concepts/synchronization.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ When a channel first becomes active in a region, the channel loads the object da
41
41
42
42
While Ably maintains the source of truth on the channel, each connected client keeps a local representation of the objects on the channel.
43
43
44
-
When the client first attaches to the channel, the state of the channel objects is streamed to the client. [Lifecycle events](/docs/liveobjects/lifecycle#synchronization) allow your application to be notified when the local state is being synchronized with the Ably service.
44
+
When the client first attaches to the channel, the state of the channel objects is streamed to the client. Large objects, such as maps with many entries, may be delivered across multiple messages during synchronization. [Lifecycle events](/docs/liveobjects/lifecycle#synchronization) allow your application to be notified when the local state is being synchronized with the Ably service.
Copy file name to clipboardExpand all lines: src/pages/docs/liveobjects/inband-objects.mdx
+65-10Lines changed: 65 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,17 +35,28 @@ If you're using LiveObjects from one of the the following languages, then use th
35
35
*[Java](/docs/liveobjects/quickstart/java)
36
36
</Aside>
37
37
38
-
Inband objects works by delivering changes to channel objects as regular channel messages, similar to [inband occupancy](/docs/channels/options#occupancy).
38
+
Inband objects works by delivering changes to channel objects as regular channel messages, similar to [inband occupancy](/docs/channels/options#occupancy). Two modes are available:
39
+
40
+
*`objects` streams the full state of channel objects as a sequence of messages on attach and whenever the state changes.
41
+
*`notification` sends a lightweight notification whenever the state changes, with a link to retrieve the full state via the [REST API](/docs/liveobjects/rest-api-usage).
39
42
40
43
<Asidedata-type='usp'>
41
44
Scalable message fanout
42
45
43
46
Inband object updates are delivered as regular channel messages through Ably's [horizontally scalable architecture](/docs/platform/architecture/platform-scalability), so LiveObjects state changes can be distributed to any number of subscribers simultaneously.
Clients require the `channel-metadata`[capability](/docs/auth/capabilities) to receive inband objects updates.
51
+
</Aside>
52
+
53
+
## Objects mode <aid="objects-mode"/>
54
+
55
+
The `objects` mode streams the full state of channel objects to the client. On attach, the client receives a sequence of `[meta]objects` messages describing the complete set of objects on the channel. When objects are updated, the client receives additional messages with the updated state.
47
56
48
-
To enable inband objects, use the `objects`[channel parameter](/docs/channels/options#objects) when getting a channel:
Clients require the `channel-metadata`[capability](/docs/auth/capabilities) to receive inband objects updates.
63
-
</Aside>
64
-
65
-
## Subscribe to updates <aid="inband-objects-subscribe"/>
72
+
### Subscribe to updates <aid="inband-objects-subscribe"/>
66
73
67
-
When using inband objects, the client will receive special`[meta]objects` messages whenever the objects on the channel are updated. These messages provide a snapshot of the current set of objects on the channel.
74
+
The client receives`[meta]objects` messages whenever the objects on the channel are updated. These messages provide a snapshot of the current set of objects on the channel.
68
75
69
76
<Asidedata-type='note'>
70
77
If there is a high rate of updates to the channel objects the inband messages are throttled. However, the client is guaranteed to receive a sequence of inband messages after the last change occurs so that the latest data is always available.
## Message Format <aid="inband-objects-message-format"/>
92
+
###Message format <aid="inband-objects-message-format"/>
86
93
87
94
Inband objects messages are sent as a sequence of messages, where each message contains a snapshot of a single object on the channel. Taken together, a set of messages belonging to the same sequence describes the complete set of objects on the channel.
88
95
@@ -97,3 +104,51 @@ The message `data` is a JSON object with the following top-level properties:
97
104
|`object`| A JSON representation of the object included in the message. |
98
105
99
106
The shape of the `object` is the same as the response format of an object when listing them via the [REST API](/docs/liveobjects/rest-api-usage#fetching-objects-list-values).
107
+
108
+
## Notification mode <aid="notification-mode"/>
109
+
110
+
The `notification` mode sends a `[meta]objects` message whenever the channel objects are updated. The message contains a link to retrieve the current state via the [REST API](/docs/liveobjects/rest-api-usage) rather than the full object state.
111
+
112
+
Unlike `objects` mode, the client does not receive the initial state on attach. The first `[meta]objects` message is sent when the state changes.
113
+
114
+
<Asidedata-type='note'>
115
+
Use notification mode when individual objects on the channel may exceed the 64 KiB [message size limit](/docs/liveobjects/storage#operation-size).
### Subscribe to notifications <aid="notification-subscribe"/>
130
+
131
+
Subscribe to `[meta]objects` messages to receive notifications when channel objects are updated:
132
+
133
+
<Code>
134
+
```javascript
135
+
channel.subscribe('[meta]objects', (message) => {
136
+
const { link } =message.data;
137
+
console.log("Objects updated, retrieve state from:", link);
138
+
});
139
+
```
140
+
</Code>
141
+
142
+
<Asidedata-type='note'>
143
+
If there is a high rate of updates to the channel objects, notification messages are throttled after the first one. The client is guaranteed to receive a notification after the last change occurs.
144
+
</Aside>
145
+
146
+
### Notification message format <aid="notification-message-format"/>
147
+
148
+
Each notification message has a message `name` of `[meta]objects`.
149
+
150
+
The message `data` is a JSON object with the following property:
151
+
152
+
| Property | Description |
153
+
| -------- | ----------- |
154
+
|`link`| A relative URL path to retrieve the current channel objects via the [REST API](/docs/liveobjects/rest-api-usage#fetching-objects). For example, `/channels/{channelName}/object`. |
Copy file name to clipboardExpand all lines: src/pages/docs/liveobjects/index.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,7 +102,7 @@ For details on how using LiveObjects contributes to your billable usage, see [Bi
102
102
103
103
When using the realtime client libraries, LiveObjects usage is billed as follows:
104
104
105
-
*[State synchronization](/docs/liveobjects/concepts/synchronization#client-objects): On first attachment to a channel, or during resynchronization after a loss of continuity, the full state of channel objects is streamed to the client as [object messages](/docs/metadata-stats/stats#messages). Each object message received is counted as one message. Ably streams objects with a [tombstone](/docs/liveobjects/concepts/objects#tombstones) to maintain state consistency but these objects are not included in billing counts.
105
+
*[State synchronization](/docs/liveobjects/concepts/synchronization#client-objects): On first attachment to a channel, or during resynchronization after a loss of continuity, the full state of channel objects is streamed to the client as [object messages](/docs/metadata-stats/stats#messages). Each object message received is counted as one message. Large objects may be streamed across multiple object messages, each counted individually. Ably streams objects with a [tombstone](/docs/liveobjects/concepts/objects#tombstones) to maintain state consistency but these objects are not included in billing counts.
106
106
*[Object operations](/docs/liveobjects/concepts/operations): Creating or updating an object generates an _operation_, which is sent as an object message on the channel and billed accordingly. For example, if a user increments a counter, one object message is sent. If 10 clients subscribed to object messages receive it, that counts as 11 messages in total. Any client attached to a channel with `object-subscribe` capability is subscribed to all object messages on that channel.
107
107
*[Batch operations](/docs/liveobjects/batch): Multiple operations grouped into a batch are sent as a single object message and billed as one.
Copy file name to clipboardExpand all lines: src/pages/docs/liveobjects/storage.mdx
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,12 +37,18 @@ Short disconnections (under two minutes) are resolved by replaying missed operat
37
37
38
38
## Object size limit <aid="limits"/>
39
39
40
-
The channel object has a maximum size limit, the default is 6.5(MB). This takes into account the size of every LiveObject (Map and Counter). When calculating the size of a channel object, Ably ignores any object or map entry with a [tombstone](/docs/liveobjects/concepts/objects#tombstones).
40
+
All objects on a channel share an aggregate size limit, which defaults to 6.5 MB. This is the combined size of every `LiveMap`and `LiveCounter` on the channel. There is no limit on the number of individual objects. When calculating the aggregate size, Ably excludes any object or map entry with a [tombstone](/docs/liveobjects/concepts/objects#tombstones), as well as any [unreachable](/docs/liveobjects/concepts/objects#reachability) objects.
41
41
42
42
<Asidedata-type='note'>
43
-
If you're interested storing a larger amount of data on a channel, please [get in touch](https://ably.com/support) with your requirements.
43
+
If you're interested in storing a larger amount of data on a channel, please [get in touch](https://ably.com/support) with your requirements.
44
44
</Aside>
45
45
46
+
### Operation size <aid="operation-size"/>
47
+
48
+
Operations are limited by the message size limit of 64 KiB. This means that you cannot initialize an object with data larger than 64 KiB in a single operation. However, an object can grow beyond this size through incremental updates, for example by using a series of `set` operations on a `LiveMap`.
49
+
50
+
### Size calculation <aid="size-calculation"/>
51
+
46
52
A `LiveCounter` is a double-precision floating-point number and has a size of 8 bytes.
47
53
48
54
The size of a `LiveMap` object is calculated as the sum of the length of all keys plus the size of all values where:
Copy file name to clipboardExpand all lines: src/pages/docs/platform/pricing/limits.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,7 +102,7 @@ Therefore, to provide the realtime platform-as-a-service economically to all cus
102
102
|**Message publish rate per channel (per second)**<p>*the maximum rate at which messages can be published for each channel*</p> | 50 | 50 | 50 | 50 |
103
103
|**Presence members per channel**<p>*the maximum number of clients that can be simultaneously present on a channel*</p> | 200 | 200 | 200 | 200 |
104
104
|**Presence members per channel with [server-side batching](/docs/messages/batch#server-side) enabled**<p>*the maximum number of clients that can be simultaneously present on a channel when server-side batching is enabled*</p> | 200 | 5,000 | 10,000 | 20,000 |
105
-
|**Total object size per channel(MB)**<p>*the maximum size of a channel object*</p> | 6.5 | 6.5 | 6.5 | 6.5 |
105
+
|**Total object size per channel(MB)**<p>*the maximum aggregate size of all objects on a channel*</p> | 6.5 | 6.5 | 6.5 | 6.5 |
0 commit comments