Durable Objects
Cloudflare’s single-instance objects with their own storage: one place in the world that owns a piece of state.
Each object has a unique id, runs in one location at a time on a single thread, and its storage operations are protected from interleaving, so state races are far easier to avoid; requests can still interleave while one awaits an outside call. That makes it a natural fit for a chat room, a game lobby, a document being edited together, a counter or a budget that must never be overspent. Objects can hold WebSocket connections and wake up on alarms.
Related terms
- Edge computing (Workers): Running code in data centers close to the user, on the CDN, instead of in one central region.
- Server-Sent Events (SSE): A standard way for a server to push a stream of updates to the browser over one long HTTP response.
- Authoritative server (netcode): In multiplayer games, the server decides the true game state; clients only send inputs and predict what will happen.
