u/sebb_prisma

▲ 56 r/rust

I built a TSO (timestamp oracle) that can work with OpenRaft

I’ve been building distributed compute/database infrastructure in Rust and realized there doesn’t seem to be a clean standalone Timestamp Oracle (TSO) library in the ecosystem (or at least, not a solid one to my knowledge).

So I built one: https://github.com/prisma-risk/tsoracle

The initial use case was OpenRaft-based systems where multiple nodes need:

  • globally ordered timestamps
  • snapshot isolation / MVCC-style semantics
  • deterministic event ordering
  • monotonic IDs
  • causality/version tracking

One thing I specifically wanted was a pluggable consensus layer, so I added an OpenRaft cluster example here: https://github.com/prisma-risk/tsoracle/tree/main/examples/openraft-cluster

The basic idea:

  • OpenRaft elects a leader
  • leader allocates timestamp batches
  • timestamps remain strictly monotonic
  • persistence guarantees survive failover/restart
  • clients fetch timestamps over gRPC

Example use cases: MVCC storage engines, distributed schedulers, event sourcing, CDC pipelines, globally ordered audit logs,...

Welcoming any feedback and contributions 😄

reddit.com
u/sebb_prisma — 6 hours ago