Making mapping collaborative without paying Felt a fortune.
Felt nailed the idea that web maps should feel collaborative - drop a pin, point at a weird feature, talk about it live without emailing screenshots back and forth. I wanted that same feel inside Sarkoa without the price tag, and thankfully Cloudflare Durable Objects make the architecture pretty straightforward: one map, one room.
Two pieces make that work. A WebSocket is an open phone line between a browser and a server: either side can speak at any moment, instead of the browser sending a letter and waiting for a reply. A Durable Object is a small program with its own memory that Cloudflare guarantees exists exactly once per name. Name one after each map, and you have a room that everyone looking at that map can call into.
When two people have the same map open, both browsers open a WebSocket to that map’s Durable Object. Drop a comment or highlight something, and the room broadcasts it straight to everyone else on that map without a page refresh. Someone looking at a completely different map never hears a peep.
Auth stays lightweight too. Since the main app already knows who’s allowed to view a map, it hands the browser a signed 5-minute ticket naming the user and the map ID. (Signed means stamped with a secret only Sarkoa’s servers know, so it can’t be forged.) The collaboration service just checks the stamp on connect - it doesn’t need to know anything else about the user’s account.
Pinned notes vs. “look here” marks
Pinned comments stick around permanently, while quick pointers and highlights expire after a few seconds so a disconnected tab doesn’t leave ghosts littered across the map. If you join while a pointer is still live, you see it right away; if you show up after it expires, it’s gone - no point showing you where someone was pointing ten minutes ago.
I verified the room isolation and expiry alarms with a quick 3-viewer simulation (two on the same map, one on a different map): both viewers on Map A get the mark immediately, a fresh room load 5 seconds later still sees it, at 6 seconds the alarm fires and clears it for both of them, and the viewer on Map B gets nothing (per-viewer events and snapshot counts).