Pingerchips LogoPingerchips
Durable ObjectsReference

Architecture

Storage: RocksDB per vnode

Each object's data lives in an embedded RocksDB instance — in-process, no network hop.

Loading diagram…

All keys for one object share a prefix — rehydration is a single prefix scan, not a scatter-gather.

OperationMechanismLatency
Read (hot)In-memory map~0 ns
Read (cold)RocksDB bloom filter + memtable~10 µs
WriteMemtable + WAL append~50 µs
Rehydrate (snapshot)Single key read~10 µs
Log replaySequential prefix scan~1 µs/entry

DurableObject Worker lifecycle

Loading diagram…

The Worker serialises all writes — no per-slot locking needed. RocksDB data persists on the vnode regardless of Worker state.


Write path

Loading diagram…

Every write, Chat token streaming included, goes through this one transaction path. The state snapshot is rewritten only when a commit crosses a multiple of 32 log ids; on crash + rehydrate, the snapshot plus the log entries after it rebuild the state exactly.


Distribution: riak_core_lite ring

Loading diagram…

Routing: partition = SHA-160(app_id <> "/" <> type <> "/" <> key) % 256 — pure arithmetic, ~500ns, no network call.

Handoff: when nodes join/leave, the vnode's RocksDB key range streams to the new owner. Object state migrates with the partition.

Cold reads: served directly by the vnode from RocksDB — no Worker started, memory proportional to active objects only.

Replication quorum

The replication factor adapts to the number of active cluster nodes:

Active nodesNRW
1111
2222
3 or more322

A write coordinator takes a cluster-wide advisory lock, does a quorum read to pick the canonical snapshot (highest log_id present on ≥R replicas, read-repairing stale ones), evaluates the operation once, then writes to W replicas with a per-replica version check. The W=2 intersection plus the version check are what stop two conflicting writes both succeeding during a partition — the advisory lock is best-effort, not consensus.


Real-time subscribe flow

Loading diagram…

Supervision tree

Loading diagram…

Workers are :temporary — not restarted on crash. Next access rehydrates from RocksDB. A crashed Worker is equivalent to an evicted one.

On this page