One of the questions we get asked most often: how does Readyset serve cached reads without ever taking a lock?
The answer is a pattern called left-right. Instead of making readers and writers compete over the same data, Readyset keeps two copies. Readers use one while writes happen on the other, then a single atomic pointer flip makes the updated data visible. Readers never wait on writes, and writes never block readers.
Full writeup with benchmarks and an honest look at the tradeoffs here.

Top comments (1)
I found the left-right pattern used in Readyset to be really interesting, as it allows for lock-free cache reads by essentially maintaining two copies of the data. I'm curious to know more about how this approach handles cache consistency and potential data inconsistencies that may arise from having two copies of the data. The atomic pointer flip seems like a key component in ensuring data visibility, but I'd love to see more details on how this works in practice. Does the article go into more depth on this topic in the full writeup, or are there any plans to explore this further in a follow-up post?