Durable Objects Don't Tempt Fate, Maintain State
summary
Cloudflare Durable Objects run on Workers and provide a stateful, single-threaded instance per key that serializes requests, keeps in-memory state with on-disk persistence, and supports long‑lived WebSocket sessions. Live demos include a drawing room demo that broadcasts strokes to connected clients, persists them and enforces a 1000-stroke limit to avoid unbounded growth. Durable Objects route all requests for a key to the same single-threaded instance, trade slightly higher latency for strong consistency, and work for real‑time games, collaborative editors, sessions, and small stateful agents.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 0:55Cloudflare developer platform
- 6:38Durable Objects explained
- 9:11Problem with state in serverless
- 9:33Solution with Durable Objects
- 10:16How Durable Objects work
- 13:46Demo: Collaborative drawing
- 18:28Demo: Coffee counter
- 19:10Durable Objects use cases
- 21:59Why better than traditional servers
- 23:43When to use Durable Objects
- 24:46Durable Objects vs KV storage
- 25:50Future of Durable Objects
- 27:37AI agents with Durable Objects
- 28:39Further resources
- 29:20Q&A session
