Due to the nature of some distributed systems, real-time consistency between requests is difficult to enforce implicitly. A solution is to allow protocol support in the form of multiple synchronization tokens. Synchronization tokens are optional.
To guarantee real-time consistency between different client instances and requests, use optional
Sync-Token request and response headers.
||Token ID (opaque)|
||Token value (opaque). Allows base64 encoded string.|
||Token sequence number (version). Higher means a newer version of the same token. Allows for better concurrency and client caching. The client can choose to use only the token's last version, because token versions are inclusive. This parameter isn't required for requests.|
The service provides a
Sync-Token header with each response.
Any subsequent request is guaranteed real-time consistent response in relation to the provided
If you omit the
Sync-Token header from the request, it's possible for the service to respond with cached data during a short period of time (up to a few seconds), before it settles internally. This behavior might cause inconsistent reads if changes occurred immediately before reading.
The server might respond with multiple synchronization tokens for a single request. To keep real-time consistency for the next request, the client must respond with all of the received synchronization tokens. Multiple header values must be comma-separated.