01 / DECISION
When this primitive earns a place
Use a Durable Object for per-room, per-user, per-resource, or per-workflow coordination that needs strongly consistent ownership.
02 / ARCHITECTURE
Build the smallest defensible path
Write the invariant first, derive a stable object ID, keep methods bounded, persist only necessary state, and define alarms or cleanup.
- 01Name the contract
Use a Durable Object for per-room, per-user, per-resource, or per-workflow coordination that needs strongly consistent ownership.
- 02Add one primitive
Write the invariant first, derive a stable object ID, keep methods bounded, persist only necessary state, and define alarms or cleanup.
- 03Capture failure evidence
Race concurrent requests against one object, restart between operations, and prove the invariant, persistence, and cleanup behavior.
03 / REPRODUCE
Evidence before confidence
Race concurrent requests against one object, restart between operations, and prove the invariant, persistence, and cleanup behavior.
npx wrangler types 04 / BOUNDARY
The production boundary
A single object can become a hot key. Durable Objects coordinate state; they do not make an unbounded workload free or infinitely parallel.
05 / FIRST-PARTY SOURCES
Keep first-party sources authoritative
Product behavior, limits, pricing, and availability can change. Re-check these sources before acting.