Why Snowflake IDs do not prove event order

See how clock skew breaks timestamp ordering across machines and choose safer causality and sequencing strategies.

Clock Skew And ID Ordering

Clock skew breaks the assumption that timestamps from different machines are directly comparable.

If IDs are generated as:

and one machine's clock is ahead, it can emit a larger ID before another machine emits an older timestamp.

Numeric order no longer equals true event order.

Consider a profile service using "largest Snowflake ID wins" to choose the latest update. Server B is three seconds ahead and writes an old email address after reading stale input. Server A then writes the correct email address with a lower timestamp. If the merge rule trusts ID order, the stale write wins.

The bug is not duplicate IDs. The bug is treating approximate time as causality. Time-sortable IDs are good cursors, but they are weak conflict detectors.

NTP sync intervals, CPU scheduling pauses, virtualization pauses, clock adjustments, leap-second handling, hardware clock drift, overloaded machines, time moving backward after correction.

Time-sortable IDs are usually good enough for:

pagination, rough ordering, logs, human debugging, feed continuation.

They are not enough for:

financial conflict resolution, "last writer wins" correctness, distributed locking, legal/audit ordering, serializable transaction order.

For correctness-sensitive ordering, use:

database commit order, monotonically increasing sequence from one authority, consensus log index, version number on the record, compare-and-swap, fencing token, vector/lamport clocks where causality is the requirement.

Need Safer Mechanism --- --- prevent stale overwrite version column or compare-and-swap order writes to one record database transaction or per-record sequence order events in a stream broker offset or consensus log index detect causality between replicas vector clock or explicit version vector lease ownership fencing token checked by the resource

Monitor clock drift per host and alert before drift reaches the ID generator's tolerance. Record generator worker ID, wall-clock timestamp, and receive timestamp in logs so ordering incidents can be reconstructed.