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…

set_volatile: log-only writes

Used internally by Chat token streaming — skips the state snapshot write.

Loading diagram…

On crash + rehydrate, volatile log entries replay identically to normal writes.


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