Company
Date Published
Author
Gordon Chan
Word count
1373
Language
English
Hacker News points
None

Summary

Buildkite has transitioned to using UUIDv7 as the primary key for all new tables, moving away from the dual-key system of sequential integer IDs and random UUIDs. This change addresses the performance issues associated with non-time-ordered UUIDs and the complications of ensuring uniqueness with sequential integer IDs in distributed databases. UUIDv7 offers time-ordered identifiers that maintain the standard UUID format, allowing for improved database index locality and reduced write and read performance overhead. The decision to adopt UUIDv7 was influenced by its compatibility with existing systems and its potential to become a future standard, providing a streamlined identifier solution that eliminates the need for coordinated key generation and simplifies application logic. While Buildkite evaluated other implementations, such as Instagram's ShardingID and Shopify's composite primary key, the stability and standardization potential of UUIDv7 ultimately led to its adoption, despite the slight storage overhead compared to other solutions.