# denoland/celld architecture

> Architecture diagram of the GitHub repository denoland/celld, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/denoland/celld
- Repository: https://github.com/denoland/celld

## Overview

celld is a self-hosted distributed Workers/Durable Objects daemon. The main path is project deployment to a shared bucket, then node ownership and routing of requests to a cell, where the embedded runtime executes the Worker and persists SQLite state. Durable writes are captured as LTX, replicated to peers and uploaded for long-term storage; takeover restores from that state. The README documents additional bindings, assets, workflows, cron, and container support. Some internal links below rely on SOURCE INDEX references rather than inspected call sites.

Main entry points: [`crates/celld/actor.rs`](https://github.com/denoland/celld/blob/main/crates/celld/actor.rs) (Cell actor), [`crates/celld/js.rs`](https://github.com/denoland/celld/blob/main/crates/celld/js.rs) (Worker runtime), [`crates/ltx/src/replica.rs`](https://github.com/denoland/celld/blob/main/crates/ltx/src/replica.rs) (Replication and restore), [`crates/celld/generation.rs`](https://github.com/denoland/celld/blob/main/crates/celld/generation.rs) (Generation manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_deploy["Deploy and runtime"]
  node_deploy_cmd["Deploy command<br/>[deploy.rs]"]
  node_asset_service["Static assets<br/>[assets.rs]"]
  node_generation["Generation manager<br/>[generation.rs]"]
  node_worker_runtime["Worker runtime<br/>[js.rs]"]
end

subgraph group_cells["Cells and bindings"]
  node_cell_actor["Cell actor<br/>[actor.rs]"]
  node_host_services["Host services<br/>[host_services.rs]"]
  node_bindings["Workers bindings<br/>[js.rs]"]
  node_container_runtime["Container support<br/>[container.rs]"]
  node_logic["Cell and service logic<br/>[lib.rs]"]
end

subgraph group_fleet["Fleet coordination"]
  node_ownership["Cell ownership<br/>[ownership_store.rs]"]
  node_peer_transport["Peer transport<br/>[peer_tunnel.rs]"]
end

subgraph group_durability["Durability and storage"]
  node_bucket[("Shared object bucket<br/>[bucket.rs]")]
  node_sqlite_storage[("SQLite cell storage<br/>[storage.rs]")]
  node_ltx_capture["LTX capture<br/>[db.rs]"]
  node_ltx_format["LTX format<br/>[ltx.rs]"]
  node_replication["Replication and restore<br/>[replica.rs]"]
  node_object_store_client["Object-store client<br/>[object_store.rs]"]
end

node_operator(("Operator"))
node_project["Worker project"]
node_http_user(("HTTP caller"))

node_operator -->|"deploys"| node_deploy_cmd
node_project -->|"supplies bundle"| node_deploy_cmd
node_deploy_cmd -->|"stores deployment"| node_bucket
node_operator -->|"starts node"| node_generation
node_generation -->|"configures"| node_worker_runtime
node_generation -->|"loads assets"| node_asset_service
node_http_user -->|"requests cell"| node_cell_actor
node_cell_actor -->|"executes"| node_worker_runtime
node_worker_runtime -->|"uses services"| node_host_services
node_worker_runtime -->|"exposes"| node_bindings
node_worker_runtime -.->|"supports containers"| node_container_runtime
node_cell_actor -.->|"uses domain logic"| node_logic
node_cell_actor -->|"claims cell"| node_ownership
node_ownership -->|"writes ownership"| node_bucket
node_cell_actor -->|"persists state"| node_sqlite_storage
node_sqlite_storage -->|"captures commits"| node_ltx_capture
node_ltx_capture -->|"encodes changes"| node_ltx_format
node_cell_actor -->|"replicates writes"| node_replication
node_replication -->|"sends to peers"| node_peer_transport
node_replication -->|"uploads and restores"| node_object_store_client
node_object_store_client -->|"reads and writes"| node_bucket
node_replication -->|"reads LTX"| node_ltx_format

click node_deploy_cmd "https://github.com/denoland/celld/blob/main/crates/celld/deploy.rs"
click node_asset_service "https://github.com/denoland/celld/blob/main/crates/celld/assets.rs"
click node_generation "https://github.com/denoland/celld/blob/main/crates/celld/generation.rs"
click node_worker_runtime "https://github.com/denoland/celld/blob/main/crates/celld/js.rs"
click node_cell_actor "https://github.com/denoland/celld/blob/main/crates/celld/actor.rs"
click node_host_services "https://github.com/denoland/celld/blob/main/crates/celld/host_services.rs"
click node_bindings "https://github.com/denoland/celld/blob/main/crates/celld/js.rs"
click node_container_runtime "https://github.com/denoland/celld/blob/main/crates/celld/container.rs"
click node_logic "https://github.com/denoland/celld/blob/main/crates/logic/lib.rs"
click node_ownership "https://github.com/denoland/celld/blob/main/crates/celld/ownership_store.rs"
click node_peer_transport "https://github.com/denoland/celld/blob/main/crates/celld/main/peer_tunnel.rs"
click node_bucket "https://github.com/denoland/celld/blob/main/crates/celld/bucket.rs"
click node_sqlite_storage "https://github.com/denoland/celld/blob/main/crates/celld/storage.rs"
click node_ltx_capture "https://github.com/denoland/celld/blob/main/crates/ltx/src/db.rs"
click node_ltx_format "https://github.com/denoland/celld/blob/main/crates/ltx/src/ltx.rs"
click node_replication "https://github.com/denoland/celld/blob/main/crates/ltx/src/replica.rs"
click node_object_store_client "https://github.com/denoland/celld/blob/main/crates/ltx/src/client/object_store.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_deploy_cmd,node_asset_service,node_generation,node_worker_runtime toneBlue
class node_cell_actor,node_host_services,node_bindings,node_container_runtime,node_logic toneAmber
class node_ownership,node_peer_transport toneMint
class node_bucket,node_sqlite_storage,node_ltx_capture,node_ltx_format,node_replication,node_object_store_client,node_project toneRose
class node_operator,node_http_user toneIndigo
```

## Components

### Deploy and runtime

- [Deploy command](https://github.com/denoland/celld/blob/main/crates/celld/deploy.rs): `crates/celld/deploy.rs`
- [Static assets](https://github.com/denoland/celld/blob/main/crates/celld/assets.rs): `crates/celld/assets.rs`
- [Generation manager](https://github.com/denoland/celld/blob/main/crates/celld/generation.rs): `crates/celld/generation.rs`
- [Worker runtime](https://github.com/denoland/celld/blob/main/crates/celld/js.rs): `crates/celld/js.rs`

### Cells and bindings

- [Cell actor](https://github.com/denoland/celld/blob/main/crates/celld/actor.rs): `crates/celld/actor.rs`
- [Host services](https://github.com/denoland/celld/blob/main/crates/celld/host_services.rs): `crates/celld/host_services.rs`
- [Workers bindings](https://github.com/denoland/celld/blob/main/crates/celld/js.rs): `crates/celld/js.rs`
- [Container support](https://github.com/denoland/celld/blob/main/crates/celld/container.rs): `crates/celld/container.rs`
- [Cell and service logic](https://github.com/denoland/celld/blob/main/crates/logic/lib.rs): `crates/logic/lib.rs`

### Fleet coordination

- [Cell ownership](https://github.com/denoland/celld/blob/main/crates/celld/ownership_store.rs): `crates/celld/ownership_store.rs`
- [Peer transport](https://github.com/denoland/celld/blob/main/crates/celld/main/peer_tunnel.rs): `crates/celld/main/peer_tunnel.rs`

### Durability and storage

- [Shared object bucket](https://github.com/denoland/celld/blob/main/crates/celld/bucket.rs): `crates/celld/bucket.rs`
- [SQLite cell storage](https://github.com/denoland/celld/blob/main/crates/celld/storage.rs): `crates/celld/storage.rs`
- [LTX capture](https://github.com/denoland/celld/blob/main/crates/ltx/src/db.rs): `crates/ltx/src/db.rs`
- [LTX format](https://github.com/denoland/celld/blob/main/crates/ltx/src/ltx.rs): `crates/ltx/src/ltx.rs`
- [Replication and restore](https://github.com/denoland/celld/blob/main/crates/ltx/src/replica.rs): `crates/ltx/src/replica.rs`
- [Object-store client](https://github.com/denoland/celld/blob/main/crates/ltx/src/client/object_store.rs): `crates/ltx/src/client/object_store.rs`

### Other components

- **Operator**
- **Worker project**
- **HTTP caller**

## Connections

- Operator → Deploy command: deploys
- Worker project → Deploy command: supplies bundle
- Deploy command → Shared object bucket: stores deployment (evidence: `crates/celld/deploy.rs`)
- Operator → Generation manager: starts node
- Generation manager → Worker runtime: configures (evidence: `crates/celld/generation.rs`)
- Generation manager → Static assets: loads assets (evidence: `crates/celld/generation.rs`)
- HTTP caller → Cell actor: requests cell
- Cell actor → Worker runtime: executes (evidence: `crates/celld/actor.rs`)
- Worker runtime → Host services: uses services (evidence: `crates/celld/js.rs`)
- Worker runtime → Workers bindings: exposes (evidence: `crates/celld/js.rs`)
- Worker runtime → Container support: supports containers (evidence: `crates/celld/js.rs`)
- Cell actor → Cell and service logic: uses domain logic
- Cell actor → Cell ownership: claims cell (evidence: `crates/celld/actor.rs`)
- Cell ownership → Shared object bucket: writes ownership
- Cell actor → SQLite cell storage: persists state
- SQLite cell storage → LTX capture: captures commits
- LTX capture → LTX format: encodes changes (evidence: `crates/ltx/src/db.rs`)
- Cell actor → Replication and restore: replicates writes
- Replication and restore → Peer transport: sends to peers
- Replication and restore → Object-store client: uploads and restores (evidence: `crates/ltx/src/replica.rs`)
- Object-store client → Shared object bucket: reads and writes (evidence: `crates/ltx/src/client/object_store.rs`)
- Replication and restore → LTX format: reads LTX (evidence: `crates/ltx/src/replica.rs`)
