Jump to a problem, path or page
Jump to a problem, path or page
01 · Develop the design
Use explicit timestamp/worker/sequence fields with serialized per-worker generation and conservative issuance bounds. Uniqueness depends on exclusive worker identity ownership and safe persisted restart state.
Stage 1
Budget the bit fields
A signed 64-bit positive layout can reserve 41 timestamp bits, 10 worker bits and 12 sequence bits. State the epoch, tick duration and lifetime.
Stage 2
Treat worker reuse as a protocol
A lease alone cannot stop a paused old process from issuing IDs. Use exclusive provisioning for this design; safe reuse requires draining/fencing old issuers and preserving high-water marks.
Stage 3
Define restart behavior
Persist or reserve a timestamp high-water bound before acknowledging IDs. A restarted process must advance beyond previously reserved time, not reset its sequence against an old tick.
02 · Work through the method
03 · Justify the choices
What should happen when the clock goes backward?
Wait or refuse issuance until the documented monotonic bound is safe
Reusing a previous timestamp/worker/sequence combination breaks uniqueness.
Does a time-sortable ID establish global event order?
No; clock skew and concurrent generation prevent strict global ordering
Approximate timestamp order is not a globally serialized event history.
What happens on sequence exhaustion within one tick?
Wait for a safe later tick or return a bounded retryable error
Reusing sequence numbers in the same timestamp/worker namespace creates duplicates.
04 · Plan the evidence