Company
Date Published
Author
Premkumar Thangamani
Word count
992
Language
English
Hacker News points
None

Summary

Scaling Sequences with Server-Level Caching in YugabyteDB` explores how to generate unique, sequential numbers efficiently in a distributed database like YugabyteDB. The article discusses the challenges of generating unique values in a multi-application environment and introduces database sequences as a solution. It shows how sequences can be used to prevent duplicate values and provide sequential numbers. However, in a distributed setup, this approach has limitations due to latency issues caused by replication and caching. To address these challenges, YugabyteDB now supports server-level sequence caching, which enables all connections to share the same cached sequence values across specific YB-Tserver nodes. This reduces latencies in multi-region setups and improves performance of applications that rely on database sequences. By using server-side UUIDs or application-side ULIDs when possible and enabling per-server sequence caching, developers can improve the efficiency of their distributed applications.