news.volyx.in

Goodbye integers, hello UUIDv7 (buildkite.com)

726 points by juanfatas · 1058 days ago · 363 comments on HN

Article summary

Buildkite has adopted UUIDv7 as its primary key, replacing sequential integers and random UUIDs. UUIDv7 offers a time-ordered identifier that combines the benefits of efficient indexing and uniqueness. The company experimented with time-ordered UUIDv4 and observed improved database performance. The adoption of UUIDv7 simplifies application logic and eliminates the need for coordinated identifier generation.

Main themes

  • UUIDv7 adoption
  • Database performance
  • Distributed systems
  • Sharding strategies
  • Primary key selection
  • Query patterns and indexing

What commenters say

  • Randomly sharded keys can provide more consistent performance in distributed systems, but may lead to hotspots in certain use cases.
  • Sequential storage can be desirable for latency and throughput, but may not always be the best approach.
  • UUIDs can be beneficial for data with disjointed access patterns, but may not be necessary for all use cases.
  • The choice of primary key depends on the specific use case and query patterns, with no one-size-fits-all solution.
  • Distributed databases should consider using hash functions or consistent hashing strategies to shard data effectively.
  • The use of UUIDv7 can improve database performance, but may require rearchitecting the data store or adjusting query patterns.