Urgent.News

What's breaking now, across thousands of outlets.

Tech

Vector Clocks, Explained With a Budget

In short: When the same data is edited on several devices, "keep the newest" is unreliable, because device clocks disagree and messages arrive late. Vector clocks record what each device had seen , so a system can tell a genuine conflict from an update that simply arrived late. I explain them with a budget, plus three bugs that taught me to handle all four possible outcomes. My budget lives on a…

Vector clocks are a tool to detect conflicts in distributed systems when the same data is edited on multiple devices. They provide a way to distinguish between genuine changes and updates that simply arrived late. Instead of relying on wall-clock timestamps, which can be inaccurate due to clock discrepancies and delayed messages, vector clocks track the number of changes each machine has seen. This allows the system to determine whether an incoming change is newer, older, or a true conflict with existing updates.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Friday 9 October →