Product Introduction
- Definition: celld is a self-hosted, distributed runtime for Cloudflare's Durable Objects. Technically, it is a stateful distributed system built on V8, SQLite, and the LTX replication format, designed to execute unmodified Workers and Durable Objects code on user-controlled infrastructure.
- Core Value Proposition: It exists to provide the powerful Durable Objects programming model—a single-threaded, globally addressable object with persistent storage—while solving the critical problems of vendor lock-in, prohibitive cost at scale, and lack of data ownership. Its primary value is enabling cost-efficient, self-hosted Durable Objects with full control over data and infrastructure.
Main Features
- Self-Hosted Distributed Runtime: celld allows you to deploy your existing Cloudflare Workers and Durable Objects code to your own virtual machines or servers. It provides a compatible API layer, meaning your application logic requires no changes. The runtime manages the distribution and execution of "cells" (the equivalent of Durable Objects) across a fleet of nodes you operate.
- Cloud Bucket State Storage: Instead of storing state in Cloudflare's managed infrastructure, celld persists the state of each cell as a SQLite database and continuously replicates it to a cloud storage bucket (like AWS S3, Google Cloud Storage, or equivalent) that you own and control. It uses the LTX (Litestream Transaction) format for efficient, incremental replication of SQLite write-ahead log segments.
- Decentralized Coordination via Bucket: The system eliminates complex consensus protocols. Cell ownership and placement are coordinated through atomic compare-and-swap operations on records stored directly in the user's S3-compatible bucket. This makes the bucket the single source of truth for cell leases, enabling simple failover and recovery without a separate coordination service.
- High Density & Predictable Cost Model: celld is engineered for extreme density, packing approximately 1,000 resident cells (active objects) per 8 GB of node RAM. Inactive cells incur near-zero cost, storing only their state in the bucket. This creates a predictable, linear cost model based on node capacity rather than a per-active-object fee, leading to orders of magnitude cost savings at scale.
Problems Solved
- Pain Point: Prohibitive Cost of Durable Objects at Scale. Cloudflare's pricing model charges per "resident object-month," which becomes extremely expensive for applications with thousands or millions of intermittently active objects (e.g., chat rooms, game sessions, user sessions). celld replaces this with a infrastructure-centric cost model.
- Pain Point: Lack of Data Ownership and Portability. With managed Durable Objects, your application's state is locked into Cloudflare's ecosystem. celld solves this by storing all data in your own cloud bucket, giving you full ownership, control, and the ability to audit or migrate data directly.
- Target Audience: Developers and DevOps Engineers building real-time, stateful applications (like collaborative apps, multiplayer games, IoT platforms) who are attracted to the Durable Objects programming model but require cost predictability, data sovereignty, and the ability to deploy on their own cloud or on-premises infrastructure.
- Use Cases: Distributed Chat Applications with thousands of concurrent rooms; Multiplayer Game Session Servers; User Session Management for large-scale web applications; IoT Device State Synchronization hubs; any scenario requiring a simple, stateful, globally addressable actor model beyond toy scale.
Unique Advantages
- Differentiation vs. Cloudflare Durable Objects: While offering API compatibility, celld differentiates on architecture and economics. It trades Cloudflare's global edge network and managed service for user-controlled infrastructure, bucket-based state storage, and a cost model based on node capacity rather than per-object residency. This shifts the failure domain and operational responsibility to the user but offers radical cost savings and control at scale.
- Key Innovation: Leveraging the Bucket as the Coordination Plane. The core innovation is using a cloud storage bucket's atomic write capabilities for distributed system coordination (cell ownership/leases), eliminating the need for a separate consensus service like etcd or a complex membership protocol. This simplifies the architecture dramatically. The tight integration of V8 (for Workers runtime), SQLite (for per-cell state), and LTX (for robust replication) into a single, lightweight binary is also a significant technical achievement.
Frequently Asked Questions (FAQ)
- How is celld different from running a normal server? celld is not a generic server; it is a specialized runtime that provides the exact same programming model and API as Cloudflare Durable Objects. This means you get the developer experience of a stateful, globally addressable object (actor) without having to build the distributed systems logic for placement, persistence, replication, and failover yourself.
- What happens if my S3 bucket goes down? Since the bucket is the central coordinator and storage for cell state, its availability is critical. An S3 outage would prevent new cell leases from being acquired and block state replication. Operational reliability therefore depends on your choice of bucket provider and region. This is a deliberate design trade-off that celld makes explicit.
- Is celld production-ready? As an open-source project by Deno Land Inc., its production readiness depends on your operational expertise and risk tolerance. The technology stack (V8, SQLite, LTX) is robust, and the architecture is designed for simplicity. You are responsible for monitoring, scaling, and securing your own fleet and bucket, which is the essence of self-hosting.
- Can I use celld with existing Cloudflare Workers frontends? Yes, absolutely. A common architecture would be to use Cloudflare's global network for serving static assets and handling the initial request routing (which they excel at), while directing stateful Durable Objects requests to your self-hosted celld fleet. This hybrid approach combines strengths.
- How does failover work when a node dies? When a celld node fails, the leases it held for active cells in the S3 bucket will expire. Other healthy nodes in the fleet will detect these expired leases via periodic checks, claim them with an atomic compare-and-swap operation on the bucket record, load the latest cell state from LTX files in the bucket, and resume processing. The documented failover time is approximately 20 seconds.