2026-05-19 · 1 min read
UUID v4 in distributed systems
Random UUIDs reduce coordination; they are not a substitute for sequential business IDs.
UUIDbackenddistributed
Key takeaways
- Use v4 when you need opaque, low-collision identifiers without a central allocator.
- Validate format at API boundaries even if generation is client-side.
When v4 fits
Great for correlation IDs, upload session keys, and client-generated draft entities.
Poor fit as primary keys on huge indexed tables without understanding fragmentation costs.
FAQ
UUID v1 vs v4?
v1 is time/MAC-based; v4 is random. Prefer v4 for public IDs unless you need sortable time ordering.
How many can I generate at once?
Batch generation is fine for fixtures; avoid shipping huge lists to browsers unnecessarily.