AE NOTE
Position this as the feature the product team wants but can't justify engineering time for. The 6-month estimate came from: WebSocket server + Redis pub/sub + Socket.io cluster + load balancer + real-time DB. One DO class replaces all five. Land Durable Objects on the room planner, then expand the conversation to KV (caching), R2 (image storage), Workers AI (product recommendations). The room designer is the beachhead.
SE Talk Track
The customer says a room planner is a 6-month project: WebSocket server, Redis pub/sub, Socket.io cluster, load balancer, real-time DB. You say: one Durable Object per room. SQLite persists every furniture position and survives restarts. WebSocket Hibernation means 1,000 idle tabs cost $0/month — the DO sleeps and wakes in <5ms. The lock system (green = you hold it, red dashed = someone else does) prevents conflicts without any coordination service. The whole thing — WebSocket server, DB, pub/sub, lock manager, live cursors — is one TypeScript class, ~400 lines, deploy in under 2 minutes.
Demo Steps
Cloudflare Products
Objection: "Real-time collaboration is a 6-month build" → The DO class is ~400 lines of TypeScript. WebSocket server, SQLite DB, pub/sub broadcast, furniture lock manager, live cursors — all in one file. Deploy time: under 2 minutes with wrangler deploy. No Redis cluster to provision, no Socket.io server to manage, no load balancer to configure, no real-time DB subscription to pay for.
🏠 HÖMSTYLE · E-commerce
Place HÖMSTYLE furniture in a live 2D floor plan or 3D view. Every move syncs to all connected browsers in real time — no backend, no database, no load balancer. One Durable Object per room, SQLite for state, WebSocket Hibernation for zero idle cost.
The Problem
""We want a room planner on our product pages — customers return sofas because they can't visualise the fit. But our team scoped it as a 6-month project: real-time database, WebSocket server, Socket.io cluster, load balancer, Redis for pub/sub. We can't justify that for a planner.""
The Outcome
One Durable Object class handles WebSocket upgrades, SQLite furniture state, live cursors, and multi-user sync. No Redis. No Socket.io. No load balancer. 1,000 idle connections cost $0/month — the DO hibernates and wakes in under 5 ms.
Productionising this
Hibernation = $0 idle
Use state.acceptWebSocket() (Hibernation API), NOT server.accept(). Hibernating sockets bill ~$0; active sockets bill duration. The /demo/room-designer DO uses Hibernation correctly.
SQLite size limits
Per-DO SQLite has a 10 GB cap. For furniture rooms this is fine; for chat or telemetry, partition by day/user/region across multiple DO instances.
Migrations
DO classes need explicit migrations in wrangler.toml — new_classes, new_sqlite_classes, deleted_classes. The room-designer DO has v-room-1 → v-room-2 migration as a worked example.
Backups
SQLite in DO is durable but not snapshotted by Cloudflare. For audit/compliance, periodically dump to R2 via storage.list() + serialise.
Auth
Don't leak roomId in URLs without auth. Sign room access tokens (JWT or KV-stored short-lived) so a stranger can't connect to vardagsrum just by guessing the path.
Observability
Each DO instance is a separate trace in Workers Logs. Tag log lines with roomId + doVersion so you can replay a specific room's history when debugging.