Skip to Main Content
Patterns of Distributed Systems
book

Patterns of Distributed Systems

by Unmesh Joshi
December 2023
Intermediate to advanced content levelIntermediate to advanced
464 pages
12h 35m
English
Addison-Wesley Professional
Content preview from Patterns of Distributed Systems

Chapter 17

Versioned Value

Store every update to a value with a new version, to allow reading historical values.

Problem

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.

Solution

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Designing Distributed Systems

Designing Distributed Systems

Brendan Burns