System overview
datadata is a library with a clean client/server split and two deliberate seams — the event bus and the storage adapter — that decide where and how it runs.
┌────────────────┐│ session client │ staging layer (optional)└───────┬────────┘ │┌───────▼────────┐ ┌─────────────────┐│ client │◄───────►│ event bus │ WebSocket / in-process│ (optimistic │ events │ ││ overlay) │ └────────┬────────┘└────────────────┘ │ ┌────────▼────────┐ │ server │ │ (authoritative) │ └────────┬────────┘ │ ┌────────▼────────┐ │ storage adapter │ │ (SQLite / mem) │ └─────────────────┘The parts
Section titled “The parts”- Client — holds subscriptions and the optimistic overlay; exposes the document API to the application (and to framework bindings like the React integration).
- Session client — the staging layer, layered on a client.
- Server — the authority for one folder: validates against schemas, assigns sequence numbers, persists, broadcasts. Enforces limits (document size, rates) and exposes a change callback for automation.
- Event bus — routes protocol events between clients and server. Implementations: WebSocket (production), in-process (server-side agents, tests, demos), and a composite that combines both on one server.
- Storage adapter — persistence behind the server: documents, the event log, and Yjs state. The production implementation is SQLite in a Durable Object; tests use memory.
Where it runs today
Section titled “Where it runs today”The current production shape is Cloudflare Workers + Durable Objects: one Durable Object per folder, embedding the server, its storage, and its WebSocket connections. The seams exist precisely so that this is a deployment choice, not an identity — but Cloudflare is the only backend that exists today.