Asynchronous database replication can cause users to read progressively older values when successive reads hit replicas with different replication lags — a phenomenon likened to traveling through a wormhole. Monotonic reads is a consistency guarantee that ensures a user always sees data moving forward in time. The practical solution is to make each user's reads sticky to a specific replica, achieved by hashing the user ID to deterministically select a replica rather than picking one at random.

4m read timeFrom arpitbhayani.me
Post cover image
Table of contents
Through the wormholeMonotonic Reads
11 Impressions