Durable Objects across nodes
The constraint: workerd keeps every object local to one process, and its only durable storage mode is marked experimental. Two writers on one SQLite file corrupt it.
- Objects hash into 4096 virtual shards. A placement service on etcd leases each shard to exactly one node.
- Your code gets a proxy binding: a direct in-process call when this node owns the object, an HTTP hop to the owner when it does not.
idFromNameis identical everywhere. - The gateway routes DO-affine requests straight to the owner node so the fast path hits.
- SQLite WAL ships continuously to the object store. A dead node means a short pause for its objects, not lost state.