Celld: Self-hosted, distributed durable objects

markgavalda1 pts0 comments

celld: self-hosted, distributed Durable Objects} -->Bootcamp is coming in September &rarr;learn to build apps with AI<br>~~~<br>Ryan Dahl just launched celld.

It is an open source implementation of Cloudflare Workers and Durable Objects that runs on your own machines.

You write a Worker. You bind a Durable Object. You use the same JavaScript APIs and a familiar wrangler.jsonc file.

But you do not deploy the application to Cloudflare.

You run celld on your own VMs. Every Durable Object gets its own SQLite database. The databases are replicated to an S3-compatible bucket you control.

The bucket also coordinates the nodes.

There is no separate database cluster, placement service, membership system, or consensus service to operate.

This is a very interesting architecture.

I use Cloudflare Workers, D1, Durable Objects, Queues, R2, and many other Cloudflare services across my projects. I like the platform.

But celld takes one of its best ideas and turns it into infrastructure we can run anywhere.

The project was announced on August 5, 2026. Version 0.1.0 is available under the Apache 2.0 license in the denoland/celld repository.

It is also an alpha.

I would not move an important production system to it today. But I would absolutely build an experiment with it.

Let’s see why.

First, what is a Durable Object?

A normal serverless function is stateless.

It receives a request, does some work, and returns a response. The next request might run on another machine.

This is great until the requests need to coordinate.

Imagine a chat room with 500 connected people. Messages must have one clear order. Connections need shared state. Two users might update the same room at the same time.

You can solve this with a database, locks, a message broker, and a WebSocket service.

My free Real-time Web Applications course covers the foundations behind these long-lived connections.

Or you can send every request for that room to one Durable Object.

A Durable Object is a small, named server with private persistent storage.

You might create one object per:

chat room

user

document

game

project

device

AI agent

All requests for one object reach the same logical place.

The object handles one event at a time. It can keep hot state in memory, store data in SQLite, hold WebSocket connections, and schedule alarms.

The important idea is not the class or the API.

The important idea is this:

Give every independent piece of state one owner.

This removes a lot of coordination from the application.

Cloudflare provides the machines, routing, storage, failover, global placement, and operations behind its Durable Objects product.

celld keeps the programming model. It replaces the managed platform with V8, SQLite, LTX, an S3-compatible bucket, and a small fleet of your own machines.

What is a cell?

In celld, a cell is a Durable Object.

Each cell has:

a stable name

one current owner node

one JavaScript isolate

one private SQLite database

one ownership epoch

a replicated copy of its durable state in object storage

The name is the address.

If I create one cell for an Events Logger project called flaviocopes.com, every event for that project goes to the same cell.

Another project, waitinglists.dev, gets another cell and another database.

The two projects do not share a table. They do not compete for one database lock. A bug that damages one database does not damage the other one.

The application is sharded from the start.

This is different from the common multi-tenant design where every customer shares one large database and every query includes a tenant_id.

With celld, the boundary is physical.

One cell, one SQLite file.

The complete architecture

The shortest description of celld is:

V8 + SQLite + LTX + S3 + Tokio

Let’s expand that.

V8 runs the Worker code

Each celld node embeds V8, the JavaScript engine used by Chrome, Node.js, Deno, and Cloudflare Workers.

celld deploy reads a supported Wrangler project and uses esbuild to create the Worker bundle.

The same node runs stateless Worker requests and stateful cells.

The runtime implements a useful part of the Cloudflare Workers API, including fetch, service bindings, JavaScript RPC, Durable Objects, alarms, static assets, streams, WebSockets, and part of the Node.js compatibility layer.

This does not mean every Cloudflare application runs unchanged. I will come back to that boundary later.

SQLite stores each cell

Every cell has a separate SQLite database.

If SQLite is new to you, my free SQLite course covers how the database works and how to use its tools.

This gives the object transactions, indexes, SQL queries, and a familiar file format.

More importantly, it keeps the unit of state small.

A database for one chat room or one project is easier to move than a database for the whole application.

The cell has one writer at a time. celld uses an ownership epoch to fence old writers.

If a node loses ownership, it cannot keep writing into the current...

celld durable database object sqlite cell

Related Articles