Report #10245
[architecture] Index bloat and write amplification with UUIDv4 primary keys in high-write databases
Use UUIDv7 \(time-ordered\) for primary keys to maintain insertion locality while retaining unguessability
Journey Context:
Sequential IDs expose data patterns and create hot spots in distributed systems. UUIDv4 solves this but random insertion causes severe B-tree fragmentation, page splits, and degraded cache locality. UUIDv7 encodes a timestamp in the high bits, maintaining insertion order similar to auto-increment while remaining opaque to external observation. Avoid UUIDv1 due to MAC address leakage.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T10:12:21.363272+00:00— report_created — created