What is Strata?
Strata is a self-hosted, typed collaboration stack written in Gleam. Developers use it to build applications with concurrent document editing, presence, durable storage, and reusable collaborative components. Strata uses conflict-free replicated data types (CRDTs), so applications can merge concurrent changes without a central edit queue.
How a session works
Section titled “How a session works”- An application opens a WebSocket connection to
/socket/websocket?token=…. The server checks the token before it accepts the connection. - The application sends a
joinframe for a document. - The server sends a
snapshotthat contains the document state. - The application sends encoded ORMap state in each later
deltaframe. - The server queues the state for merge. It sends the submitted state to the other applications on the document.
Key terms
Section titled “Key terms”- Document — one collaborative state unit. The wire uses the
docfield. The server uses the topicdoc:<id>. - ORMap — the map that stores a document. It tracks enough history to merge concurrent changes.
- Delta — a frame that carries encoded ORMap state after a local edit.
- Snapshot — a frame that carries document state after join or reconnect.
- Presence — session data for a document, such as a cursor, selection, name, or color. Presence disappears when the connection closes.
What Strata provides
Section titled “What Strata provides”- Versioned JSON messages in
strata_protocol, shared by applications and the server. - Typed CRDT fields, records, document IDs, and logical clocks in
strata_document. - A server package (
strata_server) that synchronizes and persists documents. - A client package (
strata_client) that prepares outgoing messages and reads incoming messages. It supports Erlang and JavaScript. - Browser and Erlang WebSocket transport packages.
- Presence data for cursors, selections, names, and colors.
- Atomic child creation, cascading deletion, and typed references for composite document models.
- Headless component contracts with typed config, messages, outputs,
ownership, ports, and bindings in
strata_component. - A read-only admin page at
/adminthat shows documents, their sizes, active connections, and present users.
What Strata does not do
Section titled “What Strata does not do”Strata does not replace product-specific authorization, schema design, conflict semantics, or UI state management. Your application provides these functions.
The component package defines static contracts. Application hosts still manage component discovery, lifecycle, connection routing, and UI adapters. Strata does not yet persist editable component connection graphs.
Wire protocol v0 does not support separate tenants, a cluster of server nodes, or large snapshots split into smaller messages. See Limitations.