What you're looking at
A live counter shared by every visitor to this page. Anyone clicks +1 and the number jumps for everyone, no matter where they are in the world. No refresh needed.
Why this is interesting
Building this normally takes a small engineering team. You need a server that holds the count, a way to push updates to every connected browser, a database to remember the number after restarts, and code to handle the case where two people click at the exact same moment.
Cloudflare's Durable Objects collapses all of that into one tool. The entire counter, including the live updates and the saved state, is about 140 lines of code.
Where this is used in real applications
The same building block powers a lot of the products you use every day. Anywhere many people need to share live state, this is the foundation.
Inventory & Flash Sales
When 10,000 people click "Buy" on a limited-edition product at the same moment, you can't oversell. The counter goes down by exactly one for each purchase, never zero out and then back to one. Same mechanic as this demo, just counting in the other direction.
Ticket Sales
High-demand event tickets get bought in seconds. Each seat is unique and can only be sold once. The platform needs a single source of truth that processes every checkout in order, with no double-booking even under massive concurrent load.
Multiplayer Games
Game lobbies, matchmaking, real-time player state, leaderboards. Each room is its own coordinated instance. Players join, leave, and update their status in real time without a central database holding everything up.
Real-Time Collaboration
Google Docs cursors, Figma multiplayer, shared whiteboards. Every keystroke and mouse movement broadcasts to everyone else looking at the document. Each document is its own instance.
Live Auctions
Every bid is processed in order. No "lost" bids, no two people winning the same item. Everyone watching sees the current price update the moment a new bid lands.
Chat Rooms
Each room is its own instance. Messages broadcast to everyone connected. Persistent message history without running a separate database for chat.
AI Assistants
Conversation memory, tool call history, agent state. Each user's session is its own instance, surviving page refreshes and idle periods without rebuilding context every time.
Try this: Refresh the page. The count stays. Open the page on your phone. You'll see the same number as on your laptop. Click +1 on either device and watch the other one update.