Reviews & Comparisons

Cloudflare Keeps Multiplayer Game Rooms Alive Longer

Cloudflare Keeps Multiplayer Game Rooms Alive Longer FAYFO Media © fayfo.com
Cloudflare Keeps Multiplayer Game Rooms Alive Longer © fayfo.com
At 10 million monthly leaderboard reads, DynamoDB costs about $1.25 and Durable Objects about $1.80 after allowances. The larger divide is architectural: Cloudflare gives each session a single-writer object, while AWS and Google offer broader database services.

In a live match, the room’s authoritative state has to survive longer than the request that created it. Cloudflare’s October 1, 2026 change keeps Durable Objects alive for the full duration of a connection opened through connect() or an outbound WebSocket. The Connect Handler receives a Socket object of the same type returned by connect() from cloudflare:sockets for outbound connections, as described in its Connect Handler documentation.

That makes Durable Objects a stronger fit for persistent game sessions. The architecture differs from Amazon DynamoDB and Firebase Firestore: Cloudflare centers the service on a stateful unit of compute, while AWS and Google provide distributed stores with different scaling and access patterns. Requests for a particular room or session go to one addressable object. It can coordinate clients around shared authoritative state rather than acting as a general-purpose distributed table.

Room state

A Durable Object is a JavaScript or WebAssembly class instance pinned to one location, with embedded SQLite storage. Cloudflare guarantees that only one instance of a given object exists at a time across its network. A studio can assign one to a match room, then use another for a lobby or leaderboard shard. Each entity gets one authoritative writer. SQLite can persist state across restarts; in-memory variables alone do not survive hibernation or eviction.

The change tackles a specific multiplayer risk. Previously, an object’s idle timeout could cause a lobby or match room to lose authoritative state mid-session. Keeping it active while an outbound connection remains open reduces that risk.

Cloudflare’s WebSocket hibernation model also lets supported connections stay open while an object sleeps, then wake it when a message arrives. The object’s in-memory state is lost during hibernation, so developers can save data in SQLite and restore it when the object starts again. Cloudflare describes the lifecycle and recovery model in its Durable Objects WebSocket guidance. Cloudflare acquired PartyKit in 2024. Its room-based approach uses Durable Objects, commonly with one object per active room.

DynamoDB takes a different route. AWS partitions tables across its infrastructure and charges request units under on-demand capacity. Reads can be eventually consistent or strongly consistent, with the choice made per request. Applications must handle concurrent updates themselves. Leaderboard writes may require conditional checks or optimistic locking.

Firestore is a document database with client SDKs, offline caching and real-time listeners. It synchronizes data across devices. Games can connect clients directly under security rules, which can support cross-platform saves without a custom backend. Heavy contention on a shared document can become a scaling problem; Google recommends sharded counters for those cases.

What the prices show

For 10 million monthly leaderboard reads, the supplied October 2026 comparison estimates about $1.25 on DynamoDB and $1.80 on Durable Objects after the first million included reads. The Durable Objects figure assumes request units. SQLite row reads inside an object have a separate monthly allowance of 25 billion before additional charges apply.

For 5 million monthly score updates, the estimates are $3.13 on DynamoDB, $4.00 on Durable Objects after the first million included writes, and $4.50 on Firestore Standard. Those figures exclude compute, networking and surrounding application logic. Durable Objects’ listed paid-plan allowances include 1 million writes per month, then $1.00 per million. DynamoDB writes cost $0.625 per million request units. Firestore Standard charges $0.09 per 100,000 writes.

The pricing models diverge further at scale. Durable Objects charge for request units, duration measured in GB-seconds and SQLite row operations. The Workers Paid plan includes 400,000 GB-seconds monthly, then charges $12.50 per million. DynamoDB storage is listed at $0.25 per GB-month, with the first 25 GB free under qualifying conditions. Firestore bills for document operations and storage; index overhead adds to storage needs. Its Standard free tier includes 50,000 reads per day. The allowance also covers 20,000 writes and 20,000 deletes, plus 1 GiB of storage. Enterprise has different pricing and additional features, including real-time analytical queries.

At 1 million daily active users making 20 leaderboard reads and 3 writes per session, the monthly workload reaches about 600 million reads and 90 million writes. The estimates put DynamoDB at $75 for reads and $56.25 for writes. Durable Objects come to about $119.80 for reads and $89 for writes after included allowances. These totals exclude storage and compute duration, along with other costs. Firestore’s read charge depends on its current Standard rate; 90 million writes would cost about $81 before storage, egress and index overhead.

Where each fits

Independent apples-to-apples latency benchmarks for identical game workloads across the services were not publicly available at publication. Durable Objects colocate compute and storage, avoiding a network hop to a separate database for each read. DynamoDB and Firestore require an application-to-database round trip, even within the same cloud region. That difference may matter for latency-sensitive match state, but the available material does not establish a universal latency winner.

DynamoDB has documented gaming use at substantial scale. An AWS case study says Ubisoft’s Online Services team used it for roughly 20 billion data points tracking progress toward in-game challenges. The team reported a 90% database-cost reduction after moving from its previous infrastructure. AWS also documents a serverless leaderboard design built with API Gateway, Lambda and DynamoDB. Global Tables support multi-region active-active replication. DAX offers caching billed per node-hour; a documented three-node example is roughly $0.04 per node per hour.

Firestore’s client-side cache and listeners make it a practical option for mobile games that need offline play and save synchronization across iOS, Android and web. Durable Objects suit room state and presence. They can also handle chat or turn-based matches that benefit from a single writer and native WebSocket support. For WebSocket workloads, Cloudflare documents a maximum Durable Object message size of 32 MiB. The limit for unread data is 8 MiB in each direction, while pending outgoing messages are capped at 64 MiB per object.

DynamoDB has the clearest fit for high-volume key-value workloads, including inventory and leaderboards. AWS gaming infrastructure spans 31 Regions. It also covers 99 Availability Zones and 33 Local Zones.

Each option brings operational tradeoffs. Durable Objects tie a team to the Workers runtime, and a single writer may bottleneck a globally shared counter. DynamoDB has no native client push, so teams need a separate fan-out service such as AppSync or a custom WebSocket layer. Firestore’s direct client access depends on carefully designed security rules; a misconfiguration could expose player data to authenticated clients. For studios with regional requirements, Cloudflare’s Durable Objects jurisdictional restrictions are newer, so current support should be verified directly with the company.

Migration choices

Teams moving a live game should separate active match state from records that must outlast a session. They can run platforms in parallel and write to both before switching reads. Then they can test simultaneous score submissions and disconnects during writes. Moving away from Firestore also means replacing its real-time listeners; a DynamoDB migration requires deliberate partition and sort keys. The same platform-dependence question appears in publishing, where a recent GEO analysis examined the role of external sites in AI search visibility.

Many game backends can divide the work between Durable Objects for live rooms and session state, and DynamoDB or Firestore for durable records. Cloudflare’s October connection-lifetime change removes one concern about keeping an authoritative room active during a real-time multiplayer session.

Paul Christiano Editor FAYFO Media
Editor

Paul Christiano

American journalist with a strong focus on AI and content technology.

You Might Also Like