Running a Real-Time App at $0/Month Infrastructure Cost
A developer shares how they built the BatchUp group chat app in 5 days using Cloudflare Durable Objects and account sharding to stay free.

Stock photo for illustration only, not from the actual event
- BatchUp real-time chat app runs at zero dollars per month.
- Uses Cloudflare Durable Objects to isolate individual chat rooms.
- Spreads workload across 8 accounts and 7 workers to avoid limits.
- Designed to target sub-100ms message delivery latency.
Real-time data delivery is typically where standard free-tier architectures hit a wall. The moment an application requires sub-second communication across concurrent conversations, developers often turn to dedicated WebSocket servers that come with ongoing monthly bills.
A recent architectural approach shared on Dev.to outlines how to build and operate a real-time group chat application named BatchUp in just 5 days on infrastructure costing zero dollars per month at its current scale for a college community.
Real-time chat systems demand two key features that do not naturally coexist on shared single-tenant servers: strict isolation so busy conversations do not impact others, and predictable, low latency close to the end user.

Stock photo for illustration only, not from the actual event
The architecture addresses this by running each conversation inside its own Cloudflare Durable Object, an isolated compute environment scoped exclusively to a single chat. This structurally solves the noisy neighbor problem because there is no shared event loop for a heavy group chat to monopolize.
Combining Cloudflare Durable Objects with distributed account sharding eliminates micro-resource contention, but it introduces architectural overhead. Routing traffic to the correct shard and handling future rebalancing requires careful planning, weighing monetary savings against operational complexity.
The second pillar involves splitting the system across multiple Cloudflare accounts—specifically 8 accounts utilizing 7 shard workers in the current setup—rather than squeezing everything into a single account's free tier limits. Each shard worker owns a dedicated slice of incoming traffic.
Combined, the architecture aims for sub-100-millisecond message delivery. Beyond chat apps, this isolate-and-shard pattern fits any system featuring small, independent real-time state units, such as presence systems, collaborative editors, live auctions, or multiplayer game rooms.
Source: Dev.to
Found something wrong in this article? Report an issue with this article
Comments
Leave a Comment