Live Trading Available

Update Real-Time Market Price with
Cloudflare Durable Object Fanout

A demo showcasing real-time data distribution using Cloudflare Workers, Durable Objects, and WebSocket fanout architecture.

Durable Objects WebSocket Fanout
--/USD
Waiting for data...
--
--
Durable Object Fanout → 
0
Symbols
Tracked
0
Updates/sec
Real-time
--:--
Last Update
Local Time

Market Overview

0 symbols
SymbolPriceChangeVolumeIngestMasterShardReceivedTotal
📡

Waiting for market data...

Built on Cloudflare Edge

Data source → singleton DO aggregates & fans out to regional shard DOs → each shard pushes to thousands of browser clients via Hibernatable WebSockets.

Historical data served from D1 with Cache API auto-invalidation.

One write path, global read path, zero infrastructure to manage.

MasterTicker DO

Singleton Durable Object connects directly to Binance WebSocket. Aggregates trades into 1-minute K-line bars and maintains real-time price snapshots — all in-memory, zero external dependencies.

Singleton @ NRT

ShardTicker Fanout

Per-region Durable Objects subscribe to Master via WebSocket. Each shard handles up to 10K browser connections using Hibernatable WebSockets — wake on message, broadcast, sleep.

Hibernate + Auto-scale

D1 + Cache API

Completed K-line bars write to D1 edge SQL database. REST queries cached via Cache API with minute-boundary auto-invalidation. Zero CDN config, zero stale data.

Edge SQL + Smart Cache

Server-Side K-line

250ms bar snapshots pushed via WebSocket — the Binance model. No client-side aggregation, no data gaps on reconnect. Current bar from WS, history from REST.

250ms Bar Push

Zero Egress Cost

At 1M concurrent users pushing real-time data, AWS egress costs can be significant at scale — often the single largest line item on the bill. Cloudflare charges $0 for egress. Combined with Hibernatable WebSockets that let idle shards sleep between pushes, compute cost drops further. This demo pushes at full speed to showcase real-time capability; production deployments can tune push frequency to optimize cost significantly.

$0 Data Transfer

Zero-Ops Deploy

No Kafka, no EC2 clusters, no load balancers. One wrangler deploy gives you global real-time infrastructure. From code to production in seconds — freeing your team to focus on product instead of operations.

wrangler deploy