Essay #65: Preventing Wormholes in a Distributed Datastore
What happens when you have multiple Replica having different Replication Lags? A Wormhole! Let me explain…
If reads randomly go to any of the Replicas, depending on how laggy that Replica is, we would get that version of the data. This would make the values oscillate between the older and newer versions of the data, simulating a wormhole.
A very niche solution to the problem is to make User and Replica sticky implying the read request of a user always hit one specific Replica, this way the user will always see data moving forward in time and there would not be abrupt jumps.
A detailed long-form version of this guarantee called Monotonic Reads, and 64 other essays can be read arpitbhayani.me/blogs. If you are into distributed systems or advanced algorithms, you would love to binge-read them.
If you want to learn how real systems are built and managed, enroll in my 5th cohort on System Design that starts November 6th. 20 seats are still up for grabs.
We discuss and build some of the most amazing systems and in a very detailed way, not just drawing random boxes just to add components and look smart.
We build it the way it should have been built. You can find the week-by-week curriculum and topics, benefits, testimonials, and other details at https://lnkd.in/dtBk7eE.
✨ It’s time for #AsliEngineering ✨