tsoracle is a Rust service for issuing identifiers across distributed systems. Its timestamp-oracle API returns integers that are strictly increasing globally, supporting uses such as ordering database transactions, combining changes from multiple shards, and maintaining audit logs. Unlike per-machine clocks or independent database sequences, it relies on replicated consensus. The project also offers gapless sequences through a separate API: each named counter produces contiguous values for needs such as invoice numbers, order IDs, and ledger entries. These sequences are durable across crashes and failover, but their stronger guarantee has a cost: an ambiguous request failure is reported as SeqUncertain rather than retried automatically, because the counter may already have advanced.
The service allocates batches so clients can issue IDs locally after a single request. Before a timestamp range or sequence block is returned, the leader persists the new high-water mark and replicates it to followers, preventing restarts from reusing values. Production consensus drivers for OpenRaft and OmniPaxos are included, alongside a pluggable driver interface, gRPC client, metrics, and options to run a standalone binary or embed the server in a Rust application. The project describes fuzzing, crash-injection tests, and stress testing across both consensus backends. It is open source under Apache-2.0, with published crates and container deployment options; its documentation and contribution guidance cover architecture, operations, testing, and reporting issues.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.