Why the system looks this way
The core design goal is to avoid the trade-off between durability and latency that appears when append-heavy workloads are built directly on object storage. Instead of coordinating through optimistic compare-and-swap on a shared object, Tonbo Stream uses a leader-based replication model:- The leader serializes writes, so clients do not spin on conflicts.
- Followers apply the same committed command stream, so reads can stay local.
- Hot data stays on node-local disks for fast access, while colder data can move to object storage asynchronously.
stream/docs/raft-durable-stream-rfd.md and stream/docs/raft-state-machine.md.
System components
Tonbo Stream has four core layers:- HTTP API handles create, append, read, tail, bootstrap, snapshot, and inspection requests.
- Raft cluster replicates every state-changing command across nodes and commits on majority acknowledgement.
- Replicated state machine tracks buckets, streams, offsets, visibility of hot or cold payloads, producer dedup state, and snapshot metadata.
- Storage tiers keep recent payloads hot on node-local storage and allow older data to move into cold object storage without changing stream semantics.
Request flow
The write path and read path are intentionally different.Write path
- A client sends a write to the current leader.
- The leader turns that request into a stream command.
- The command is appended to the Raft log and replicated to a majority.
- Once committed, the state machine advances the stream tail and publishes the payload as visible.
- The leader returns the committed offset to the client.
Read path
- A client reads from any node.
- The node looks up stream metadata in its local state machine.
- The node serves bytes from local hot state, a published snapshot, or cold references depending on the requested offset.
- For live subscriptions, the node can continue streaming new committed entries as they become visible.
- /concepts/streams
- /concepts/offsets
- /concepts/read-modes
- /concepts/snapshots
- /concepts/durability-and-consistency
Interfaces and route families
The service currently exposes the same stream semantics through multiple route families:- Durable Streams routes under
/ds/{bucket}/{stream} - Legacy routes under
/streams/{id} - Compatibility routes under
/v1/stream/{path}
/ds routes are the primary surface used throughout this documentation because they map cleanly to buckets and stream identifiers.
Current implementation choices
The architecture notes describe a few areas where the current implementation favors delivery speed over theoretical optimality:- The Raft log store currently uses RocksDB rather than a custom pure-append segment log.
- The first production shape is a single Raft group rather than multi-Raft sharding.
- Cold tiering is optional and asynchronous so the hot path stays small.

