# Cloudflare Durable Objects
Durable Objects are [[Cloudflare]]'s primitive for *coordinated, stateful* serverless work on top of [[Cloudflare Workers]]. Each Durable Object is a single-threaded JavaScript instance with its own persistent transactional storage, addressable by a globally unique ID. Cloudflare guarantees that requests for the same ID hit the same instance, which makes them ideal for things that need a consistent serial point of control without standing up a database.
The combination of "exactly one instance per ID" + "transactional local storage" + "global addressability" gives you what is essentially a per-key actor: a tiny coordinator that you can spin up by the millions, each with its own state.
## What Problems They Solve
Traditional serverless functions are stateless and parallel ; whenever you need *one* of something (one chat room's participant list, one user's rate-limit counter, one tenant's queue, one game lobby's tick loop), you end up bolting on Redis, Postgres advisory locks, or message queues. Durable Objects collapse that pattern into the runtime itself: the *object* is the lock, the cache, and the database row.
They are particularly well suited to:
- **Rate limiting and quota enforcement**: per-user / per-org / per-API-key counters with strong consistency
- **Real-time coordination**: chat rooms, collaborative documents, multiplayer games
- **Brokers and schedulers**: hold provider credentials, hand out leases, track concurrency. [[Crabbox]] uses a Durable Object to broker access to ephemeral test runners with TTLs and spend caps
- **Per-tenant isolation**: one Durable Object per customer, naturally bounded blast radius
- **WebSocket fan-out with hibernation**: parked sockets cost nothing until a message arrives
## Storage Model
Each Durable Object has a key/value transactional store accessible only from its own instance. Reads and writes are strongly consistent. Storage is persisted on Cloudflare's distributed disk, geographically near where the Object first runs. SQL-on-DO (SQLite under the hood) is now available, giving each Object a private SQLite database.
## Why They're Different from Other Actors
Compared to Akka, Orleans, or Temporal: no cluster to operate, no membership protocol to tune, no rebalancing. The Object is born when first addressed, hibernates when idle, and is implicitly co-located with its storage. The flip side: a Durable Object is single-writer ; if you need horizontal write throughput on the same key, this is not the right primitive.
## References
- Documentation: https://developers.cloudflare.com/durable-objects/
- WebSocket Hibernation: https://developers.cloudflare.com/durable-objects/best-practices/websockets/
- SQL Storage: https://developers.cloudflare.com/durable-objects/api/sql-storage/
## Related
- [[Cloudflare]]
- [[Cloudflare Workers]]
- [[Cloudflare Agents SDK]]
- [[Cloudflare Sandbox SDK]]
- [[Cloudflare Containers]]
- [[Cloudflare D1]]
- [[Cloudflare KV]]
- [[Wrangler]]
- [[Crabbox]]