System Design Patterns: From Fundamentals to Real Systems
Vote

0% completed

​

Vector Clocks

1. The Pattern

Give each key (one stored item, like a customer's cart) a version: a small table with one counter per writer. After every write, add 1 to (increment) that writer's counter. You can then compare any two versions. If every counter in one version is greater than or equal to the matching counter in the other, that version knew about the other and replaces it (supersedes it). If each version is ahead somewhere, neither write knew about the other, so the writes were concurrent. The system then detects a true conflict instead of silently losing data.

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content