December 2023
Intermediate to advanced
464 pages
12h 35m
English
Store every update to a value with a new version, to allow reading historical values.
In a distributed system, nodes need to be able to tell which value for a key is the most recent. Sometimes they need to know past values so they can react properly to changes in a value.
Store a version number with each value. The version number is incremented for every update. This allows every update to be converted to a new write without blocking a read. Clients can read historical values at a specific version number.
Consider a simple example of a replicated key-value store. The leader of the cluster handles all the writes to the key-value store. It saves the write requests in a Write-Ahead Log. The write-ahead ...