TLDR: Monotonic Reads - How Asynchronous Replication Creates Wormholes
Date: 2021-10-03 Source: https://arpitbhayani.me/blogs/monotonic-reads
Overview
Explore how asynchronous database replication creates "wormholes" in data consistency and how to fix it with monotonic reads. Asynchronous replication leads to a fascinating situation where it feels like we are going through a wormhole traveling back and forth in time.
Key Points
- Asynchronous replication leads to a fascinating situation where it feels like we are going through a wormhole traveling back and forth in time.
- Achieving Monotonic Reads: The root cause of this seemingly random fetch lies in allowing the read request to hit Replicas with different Replication Lags.
- In this essay, we understand why this happens and the consequences and devise a quick solution to address it.
- As per Wikipedia, a wormhole can be visualized as a tunnel with two ends at different points in spacetime (i.e., different locations, different points in time, or both), allowing us to traverse back and forth in time again and again.