Dutxt
We built a collaborative text editor using Cloudflare Durable Objects to sync document edits in 45ms.
editors sync changes in 45ms.
single editor session supports 50 concurrent writers.
System Bottlenecks
Synchronizing live document edits across users often requires maintaining a stateful server cluster or running heavy database poll loops, which increases hosting costs and editing lag.
Architectural Move
We built Dutxt on SvelteKit and Cloudflare Workers. We coordinate active editor connections using Durable Objects, keeping the document state in edge memory and syncing changes over WebSockets.
Execution Path
WebSocket Coordination: We wrote Durable Object code to manage socket connections and broadcast events.
Svelte Binding: We wired the frontend text area to sync caret positions and text ranges over the WebSocket socket.
Conflict Handler: We wrote a lightweight character-locking algorithm to merge concurrent keypresses.
"We wanted a clean notepad for shared meeting notes that loaded instantly. This updates in real time without lag."
— Aseef Ahmed, Product Designer
Core Stack
- Svelte & SvelteKit
- Cloudflare Workers
- Durable Objects (Edge memory state)
Under-the-hood Challenge
Preventing data loss when users disconnect from the WebSocket. We solved this by writing the current Durable Object text buffer to a D1 database every 30 seconds, while serving the live edits from memory.
Dutxt shows that real-time document sync can run without a dedicated server cluster. Using Cloudflare’s serverless edge primitives lets us coordinate multi-user edits in memory at a fraction of the cost of legacy WebSockets hosting.