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; any comparison that labels them as single points of failure unconditionally is misleading.

.NET Example

.NET exposes RFC 9562 UUIDv7 generation:

Guid id = Guid.CreateVersion7();

Use UUIDv7 when independent writers need coordination-free IDs with useful time locality and timestamp exposure is acceptable. Do not infer exact event order from it. Two hosts can have skewed clocks, values created in the same millisecond need an implementation-defined monotonic method if creation order matters, 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