Skip to main content
株式会社オブライト

Articles tagged "WebSocket"

1 article

Software Development2026-07-04
Cloudflare Durable Objects Deep Dive — Stateful Serverless with Zero-Latency SQLite, GA in 2025, Free-Tier Available, Storage Billing Since January 7, 2026 The New Default for Chat, Collaborative Editing, Multiplayer, and LLM-Session Coordination at the Edge
**Cloudflare Durable Objects** ([official docs](https://developers.cloudflare.com/durable-objects/) / [product page](https://www.cloudflare.com/products/durable-objects/) / [SQLite in Durable Objects blog](https://blog.cloudflare.com/sqlite-in-durable-objects/)) is Cloudflare's **stateful serverless primitive that pairs compute with persistent storage inside a globally-unique instance running on Workers**. Announced in 2020, it reached **GA on SQLite storage with Workers Free-tier availability in April 2025**, then **entered its paid-billing phase on January 7, 2026** — this is now the commercial-adoption era. **Architectural core**: a **`DurableObjectStub`** derived from a name (`DurableObjectNamespace::getByName`) always routes to the single, globally-unique instance for that name → **zero-latency SQLite access** because compute and storage co-reside in the same process on the same machine. This delivers **strong-consistency single-master semantics at edge latency** — a class of distributed system that is famously hard to DIY, replaced with a single platform primitive. **Pricing** (Paid tier): - **Requests**: 1M/month included, then **$0.15 / 1M** (WebSocket inbound counts at 20:1) - **Duration**: 400,000 GB-seconds/month included, then **$12.50 / 1M GB-seconds** - **SQLite row reads**: 25B/month included, then **$0.001 / 1M** - **SQLite row writes**: 50M/month included, then **$1.00 / 1M** - **Stored data**: 5 GB-month included, then **$0.20 / GB-month** - **`setAlarm()` counts as one row write** **Free tier** (launched April 2025): 100,000 requests/day, 13,000 GB-seconds/day, 5M SQLite row reads/day, 100K writes/day, and 5 GB stored data — plenty for personal PoC and startup validation. **WebSocket Hibernation**: idle-but-eligible instances **do not accrue duration charges**. Long-lived sparse-messaging sessions (chat, notifications, LLM conversation state) become dramatically cheaper to run. **Key 2025–2026 updates**: April 7, 2025 SQLite GA + Workers Free; August 21, 2025 direct `getByName` construction; October 16, 2025 Data Studio UI editor; **October 25, 2025 WebSocket message size lifted from 1 MiB to 32 MiB**; January 7, 2026 SQLite storage billing goes live. **Representative use cases**: collaborative editing (Google-Docs-class), real-time chat, multiplayer game room-matching, live notifications, **LLM agent conversation and session state** (backend for Claude Code / Cursor-style tools), financial and IoT event buffering, distributed rate limits and locks. **Positioning**: where [Local LLM landscape (June 2026)](../columns/local-llm-landscape-2026-june-update), [agmsg](../columns/agmsg-cross-agent-messaging-cli-ai-2026-06), and [Sakana Fugu orchestration](../columns/sakana-fugu-orchestration-model-2026-06) distribute AI **inference**, Durable Objects distribute **stateful session, history, and coordination** at the edge — a natural complement rather than a competitor.
Durable ObjectsCloudflareSQLite