System Design Patterns: From Fundamentals to Real Systems

0% completed

Vector Clocks

The Pattern

Version each key with a small table of counters: one per writer. Every write increments its writer's counter. Now any two versions can be compared: if one's counters are all ≥ the other's, it knew about and supersedes it; if each is ahead somewhere, the writes were concurrent: a true conflict, detected instead of silently lost.

The quorum lesson ended with a scheduled appointment: two devices wrote the same cart at the same moment, both achieved W=2 through different replica pairs, and now two "newest" versions exist. Which wins?

.....

.....

.....

Like the course? Get enrolled and start learning!