@@ -32,22 +32,24 @@ by which a client, like a {+service-short+} SDK, can connect to a
32
32
Key Concepts
33
33
------------
34
34
35
- .. _changeset :
35
+ .. _changesets :
36
36
37
37
Changeset
38
38
~~~~~~~~~
39
39
40
40
A **changeset** is a list of instructions that describe granular modifications
41
41
made to a known object state or version by one or more write operations.
42
42
Changesets are the base unit of the sync protocol. Synced {+realm+} clients send
43
- changesets to the {+service-short+} server whenever they perfrom a write
44
- operation and the server sends each client changesets for operations executed by
45
- other clients. The {+service-short+} sync server accepts changesets from any
46
- connected sync client (including changes in a synced MongoDB cluster) at any
47
- time and uses an operational transformation algorithm to serialize changes and
48
- resolve conflicting changesets.
43
+ changesets to the {+service-short+} server whenever they perform a write
44
+ operation. The server sends each connected client the changesets for write
45
+ operations executed by other clients.
49
46
50
- .. _operational-transformation:
47
+ The {+service-short+} sync server accepts changesets from any connected sync
48
+ client (including changes in a synced MongoDB cluster) at any time and uses an
49
+ operational transformation algorithm to serialize changes into a linear order
50
+ and resolve conflicting changesets before sending them to connected clients.
51
+
52
+ .. _operational-transformations:
51
53
52
54
Operational Transformation
53
55
~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -68,7 +70,7 @@ changed object.
68
70
69
71
.. tip::
70
72
71
- An operational transformation on {+service-short+} changesets is analagous to
73
+ An operational transformation on {+service-short+} changesets is analogous to
72
74
a :git-scm:`rebase operation <docs/git-rebase>` in Git.
73
75
74
76
.. _client-file-identifier:
@@ -79,7 +81,7 @@ Client File Identifier
79
81
A **client file identifier** is a value that uniquely identifies a synced client
80
82
{+service-short+} file and its corresponding server file. The server generates a
81
83
client file identifier whenever an SDK requests one during its initial sync of a
82
- {+service-short+} file. Each identifier is a 64-bit, non-zero, positive signed
84
+ {+service-short+} file. Each identifier is a 64-bit, non-zero, positive signed
83
85
integer strictly less than 2^63.
84
86
85
87
.. note::
@@ -102,7 +104,7 @@ The SDK negotiates a WebSocket connection over HTTP and then establishes a sync
102
104
session by sending :sync-client-message:`BIND` and :sync-client-message:`IDENT`
103
105
requests to the server over the WebSocket connections. Once the session is
104
106
established, the SDK and server send synced changesets for a given
105
- {+service-short+} file to eachother via :sync-client-message:`UPLOAD` and
107
+ {+service-short+} file to each other via :sync-client-message:`UPLOAD` and
106
108
:sync-client-message:`DOWNLOAD` messages. To end the session, the SDK sends an
107
109
:sync-client-message:`UNBIND` request.
108
110
@@ -115,7 +117,7 @@ established, the SDK and server send synced changesets for a given
115
117
| |
116
118
| --------- 2. BIND -----------> |
117
119
| |
118
- | <-------- 3. IDENT* ------ ---- |
120
+ | <-- 3. IDENT (first time) ---- |
119
121
| |
120
122
| --------- 4. IDENT ----------> |
121
123
| |
@@ -156,17 +158,24 @@ The following table describes the request types that a sync client can send to a
156
158
157
159
* - .. sync-client-message:: IDENT
158
160
- Provides the :ref:`client file identifier <client-file-identifier>` that
159
- indicates which {+service-short+} file will be synced and specifies the
160
- client {+realm+}'s current version.
161
+ indicates the following:
162
+
163
+ - the {+service-short+} file to sync
164
+ - the client {+realm+}'s current version
165
+ - the client {+realm+}'s most recently synced server version
166
+
167
+ This request is related to but distinct from the
168
+ :sync-server-message:`IDENT` message sent by the server when a client
169
+ requests a client file identifier.
161
170
162
171
* - .. sync-client-message:: UPLOAD
163
- - Specifies one or more :ref:`changesets <changeset >` for operations that
164
- occured on the client. The changesets are listed by client version in
172
+ - Specifies one or more :ref:`changesets <changesets >` for operations that
173
+ occurred on the client. The changesets are listed by client version in
165
174
increasing order.
166
175
167
176
* - .. sync-client-message:: TRANSACT
168
- - Specifies a :ref:`changeset <changeset >` that describes a serialized
169
- transaction that occured on the client. The client may not upload any
177
+ - Specifies a :ref:`changeset <changesets >` that describes a serialized
178
+ transaction that occurred on the client. The client may not upload any
170
179
other changesets until the server confirms or rejects the transaction.
171
180
172
181
* - .. sync-client-message:: UNBIND
@@ -177,7 +186,7 @@ The following table describes the request types that a sync client can send to a
177
186
178
187
* - .. sync-client-message:: MARK
179
188
- Requests that the server notify the client when it has synced the latest
180
- :ref:`changeset <changeset >` in the server history (at the time of the
189
+ :ref:`changeset <changesets >` in the server history (at the time of the
181
190
request).
182
191
183
192
* - .. sync-client-message:: REFRESH
@@ -192,7 +201,7 @@ The following table describes the request types that a sync client can send to a
192
201
* - .. sync-client-message:: CLIENT_VERSION_REQUEST
193
202
- Requests that the server send the client version of the latest changeset
194
203
that was sent by the client and processed by the server. This is most
195
- commonly used to execute a client reset.
204
+ commonly used when an SDK executes a :term:` client reset` .
196
205
197
206
* - .. sync-client-message:: PING
198
207
- Indicates that the client is still connected and that the server should
@@ -225,14 +234,14 @@ server can send to a sync client:
225
234
requested the identifier.
226
235
227
236
* - .. sync-server-message:: DOWNLOAD
228
- - Specifies one or more :ref:`changesets <changeset >` (up to 16MB total)
229
- for operations that occured on other clients. The changesets are listed
237
+ - Specifies one or more :ref:`changesets <changesets >` (up to 16MB total)
238
+ for operations that occurred on other clients. The changesets are listed
230
239
by server version in increasing order.
231
240
232
241
The changesets in a DOWNLOAD may not be the exact changesets uploaded by
233
242
other clients. Instead, they may be equivalent changesets output by
234
243
{+service-short+}'s :ref:`operational transformation
235
- <operational-transformation >` algorithm.
244
+ <operational-transformations >` algorithm.
236
245
237
246
* - .. sync-server-message:: UNBOUND
238
247
- Specifies that the server ended a sync session in response to an
@@ -244,7 +253,7 @@ server can send to a sync client:
244
253
245
254
* - .. sync-server-message:: MARK
246
255
- Indicates that the server has sent the client the latest
247
- :ref:`changeset <changeset >` that was in the server history when the
256
+ :ref:`changeset <changesets >` that was in the server history when the
248
257
server received a :sync-client-message:`MARK` from the client.
249
258
250
259
* - .. sync-server-message:: STATE
@@ -262,4 +271,7 @@ server can send to a sync client:
262
271
caused by the connected client.
263
272
264
273
* - .. sync-server-message:: PONG
265
- - Acknowledges a :sync-client-message:`PING`.
274
+ - Acknowledges a :sync-client-message:`PING`. If a client does not receive
275
+ a PONG acknowledgement, it indicates that the client cannot currently
276
+ communicate with the server over the network and that the server may not
277
+ have received the corresponding :sync-client-message:`PING`.
0 commit comments