The Death of the CMS Database: Inside tnkuehne/gether

How a stateless editor uses Cloudflare edge primitives to bring real-time collaboration to Markdown files without vendor lock-in.

8 min read · tnkuehne/gether

A massive, heavy bank vault with a proprietary logo (representing a traditional CMS) sits next to a lightweight, transparent pneumatic tube system (Gether) that routes paper documents directly into a standardized, open filing cabinet. This illustrates the stateless vs stateful CMS concept.
Gether routes content directly to your repository, bypassing the proprietary database entirely.

For me, all of this boils down to one thing. Why can't we have a content editor that interacts with the codebase but doesn't need to be integrated into the frontend.

Timo Kühne, Author/Creator · timokuehne.com
Key Takeaways

The GUI Tax on Prose

For teams building static sites, there is a fundamental tension between how developers want to manage content and how writers want to write it. Developers prefer "content as code"—Markdown files living alongside the source code in a Git repository. Writers, however, need a GUI. They need live previews, rich text editing, and real-time collaboration.

The traditional solution is the Headless CMS. Platforms like Sanity or Contentful provide the interface, but at a steep cost. They introduce proprietary databases, complex API integrations, and vendor lock-in. You are forced to pay a "GUI tax" just to edit prose.

Hedcut portrait of Timo Kühne, creator of Gether.

Git, on the other hand, is not a collaboration tool. It cannot handle two people typing in the same document simultaneously. Gether bridges this gap. It provides the multiplayer experience of a modern CMS without taking ownership of the underlying data.

The Stateless Architecture

Gether is a CMS that refuses to store your content. It acts as a real-time collaborative layer sitting securely on top of the GitHub API. When you finish editing, the final Markdown file is committed directly back to your repository.

FeatureTraditional Headless CMSBare Git RepositoryGether
Content OwnershipProprietary DatabaseGit RepositoryGit Repository
Real-Time CollaborationYesNoYes
Live Preview FidelityHigh (Requires Integration)Low (Local Dev Only)High (Containerized)
Setup ComplexityHighLowMedium

This architectural choice fundamentally changes the risk profile of adopting a new tool. If Gether were to disappear tomorrow, your content remains safely version-controlled in Git, exactly as it was.

Orchestrating the Edge with Durable Objects

Achieving Google Docs-style multiplayer editing usually requires deploying heavy Kubernetes clusters and managing complex WebSocket connections. Gether bypasses this entirely by leveraging Cloudflare Durable Objects.

Cloudflare Durable Objects handle real-time WebSocket synchronization efficiently using the Hibernation API.

Inside packages/collab, Gether implements a CollaborativeDocument class. This class uses Cloudflare's Hibernation API, allowing the Worker to stay dormant until a WebSocket message arrives. This makes the service highly cost-efficient. State is persisted using the built-in SQLite storage (ctx.storage.sql), enabling structured queries of document history.

The Containerized Preview Pipeline

Live previews are the hardest problem in headless architecture. Most tools rely on regex-based Markdown parsers that attempt to mimic the final output. Gether takes a radically different approach: it spins up the actual site.

A close-up of a glass terrarium or sandbox. Inside, a tiny, hyper-detailed automated factory is rapidly assembling a printed newspaper in real-time. Thick data cables plug directly into the base of the glass box. This illustrates the Cloudflare Sandbox spinning up an actual dev server environment.
Gether uses Cloudflare Sandboxes to spin up actual dev environments for live previews.

Using Cloudflare Sandboxes, the packages/preview engine instantiates an OCI-compliant container. It clones the GitHub repo, runs pnpm install, and executes the dev command (like npm run dev for Vite or Hugo). Once the port is active, it exposes a public URL. The preview you see is identical to what will be deployed, because it is running the exact same code.

Taming State with Svelte 5 Runes

On the frontend, Gether is an early showcase of Svelte 5 in production. The editor must manage a complex matrix of user permissions, branch protections, and PR statuses across the UI.

In contribution-state.svelte.ts, Gether uses the new $state rune to create a global, reactive state object. This allows the UI to instantly toggle between "Read-only/Fork" and "Edit/Commit" modes across the Sidebar, Editor, and Toolbar without prop drilling.