Choose an identifier by its required guarantees: uniqueness scope, sort order, opacity, coordination, index locality, and behavior when clocks or allocators fail. “Globally unique and ordered” is incomplete until the system defines the namespace and ordering boundary.

Common Designs

DesignCoordinationOrder and localityFailure boundary
UUIDv4NoneRandom; poor locality in ordered indexesCollision probability, entropy source
UUIDv7None for generationTime-ordered prefix improves locality; equal timestamps need randomnessClock quality and local monotonic handling
Snowflake-styleWorker-ID allocation plus local stateRoughly time orderedClock rollback, duplicate worker IDs, sequence exhaustion
Database sequenceCentral database or partitionStrict allocation order, not commit orderDatabase availability and sequence gaps
Allocated rangesDatabase allocates blocks to generatorsOrdered within a rangeUnused gaps and duplicate range assignment

UUID uniqueness is probabilistic but extremely strong with correct randomness; it is not “non-unique.” Database and Redis allocators are not automatically single points of failure—their availability follows the deployed replication and failover design. The planned comparison visual is rejected because it states those properties as absolutes.

.NET Example

.NET exposes RFC 9562 UUIDv7 generation:

Guid id = Guid.CreateVersion7();

Use UUIDv7 when independent writers need roughly time-ordered opaque IDs. Do not infer exact event order from it: two hosts can have skewed clocks, and database commit order can differ from generation order.

For a Snowflake-style 64-bit layout, document the custom epoch, timestamp bits, worker bits, and per-tick sequence bits. Persist or coordinate worker assignment and stop generation on unhandled clock rollback. If IDs leave the trust boundary, remember that time and worker fields leak operational information.

References

  • RFC 9562: UUIDs — IETF UUID versions, uniqueness model, layouts, monotonicity, and security considerations.
  • Twitter Snowflake — original public implementation and 64-bit timestamp, worker, and sequence layout.
  • PostgreSQL sequence functions — official allocation semantics, concurrency behavior, and intentional gaps.
  • ByteByteGo: unique ID generators — provenance for the comparison categories; its visual is rejected because several guarantee and SPOF labels are false absolutes.