Ably's channel design ensures that every datacenter has the full channel history available at any point in time and is always in sync with the following caveats:
- If a message published in one datacenter has not yet arrived in another datacenter when a history query is made, then it will not be returned in the history. We cannot beat the laws of physics here, until that message has arrived in the datacenter where the query is being made, it cannot be known about (unless there is a global lock of sorts which would introduce single points of failure and significant increases in latency). Typically a message published in one datacenter will be globally available in every other datacenter within at most 100ms, and normally much quicker than that.
- If you have not enabled the message history feature for your channels, then message history is not persisted to disk and is only stored in memory for typically up to 120 seconds in each datacenter where the channel is active. As such, the consistency and accuracy of history queries is not guaranteed as this ephemeral message history is only retained for the purposes of connection state recovery (receiving messages published whilst a client is briefly disconnected).
- Once message history is enabled, Ably guarantees that a history query on a channel in any datacenter will be consistent at the time of the query (with the caveat of the time it takes for messages to arrive between datacenters, see point 1 above). All data persisted to disk is written using a quorum of our global database nodes ensuring that later history queries immediately reflect the committed changes along with any ephemeral messages not yet committed to disk, find out more.