prisma-risk

Distributed Timestamp Oracle (TSO) for Rust

15
2
100% credibility
Found May 26, 2026 at 15 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Rust
AI Summary

tsoracle is a distributed timestamp oracle service written in Rust that provides strictly increasing integer timestamps for ordering events across distributed systems. It can be run as a standalone server or embedded directly into Rust applications. The system guarantees that every timestamp issued is greater than all previous ones, even when servers crash or leadership changes. It includes sophisticated testing infrastructure that verifies this correctness under simulated chaos (server kills, network partitions, failpoints). The project is well-documented, actively maintained, and published on crates.io with an Apache 2.0 license.

How It Works

1
🔍 You need to order events across your distributed system

You're building a database or distributed application and need a reliable way to assign unique, increasing numbers to events happening on different machines.

2
📦 You install tsoracle as a service

You either run the standalone server with one simple command, or embed it directly into your Rust project with just a few lines of code.

3
🚀 You start the server

The server begins listening for requests. For important applications, you can run multiple servers that work together as a cluster to survive failures.

4
🔢 You request timestamps

Your application asks the server for unique numbers. The server guarantees that every number you receive is larger than every number given before — no duplicates, no regressions.

5
🛡️ Everything stays safe even when things break

If a server crashes or leadership changes, the system uses a special 'failover fence' mechanism that ensures timestamps remain strictly ordered even during chaos.

Your distributed system has reliable ordering

You now have a trustworthy way to sequence events across your entire system. Audit logs, database transactions, and data streams all use the same consistent ordering.

Sign up to see the full architecture

4 more

Sign Up Free

Star Growth

See how this repo grew from 15 to 15 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is tsoracle?

tsoracle is a distributed timestamp oracle written in Rust that hands out strictly monotonic integer timestamps over gRPC. Think of it as a centralized clock for distributed systems -- when you need to order events across multiple machines and local clocks aren't trustworthy enough, you call out to tsoracle instead. It uses a window-based allocator that batches timestamps and fsyncs state before issuing, so restarts never rewind the clock. The consensus layer is pluggable: you can wire it to openraft, OmniPaxos, or any replicated log that implements one trait.

Why is it gaining traction?

The pluggable consensus design is the hook. Most timestamp oracles lock you into one replication strategy; tsoracle lets you swap between openraft and OmniPaxos (or build your own driver) without changing client code. The failover fence mechanism keeps timestamps monotonic even when leadership changes mid-flight -- a subtle but critical guarantee for databases using snapshot isolation. The project also ships a serious testing apparatus: chaos injection, failpoint-driven crash tests, and a stress harness that verifies invariants under load. Benchmarks show roughly 2.4ms p50 latency on loopback with batching achieving ~1.7M timestamps per second.

Who should use this?

Database developers building MVCC or snapshot isolation engines will recognize this pattern -- Spanner, CockroachDB, and FoundationDB all use a TSO internally. Teams merging change-data from many shards into one globally ordered stream will find it useful. Anyone building audit trails that need a real "happens-before" relation across hosts. If per-host clocks or database sequences don't scale to your workload, this fills that gap.

Verdict

The project is well-architected with solid documentation and an unusually thorough test suite for something at this stage. However, with only 15 stars and a 1.0% credibility score, it's early and unproven in production. The testing infrastructure inspires confidence in correctness, but the low community adoption means you're an early adopter. Worth evaluating for greenfield projects where you can absorb that risk, but don't bet on it for critical infrastructure without running it through your own stress tests first.

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.