Status: Accepted (2026-11-27, revised for ADRs 0019-0021). Compaction triggers extended by 0312 (deletes on large snapshots); the room-close trigger below is not implemented (the age rule covers closed rooms).
page_ops: one row per accepted batch (page_id, seq, client_id, client_seq, user_id, rules_version, ops bytea). Written by each room-owner thread with COPY (binary) for all its rooms at most every GROUP_COMMIT_MS (10 ms) or 1 MiB, over one dedicated connection per owner. ACK and broadcast only after the commit.busy + retryAfterMs. Clients keep editing locally; collaborators see updates late, nothing is dropped.pages/<pageId>/<seq>.snap.gz, .struct.gz; S3-compatible in production, a local directory in dev) with metadata in page_snapshots. Postgres keeps a chunked copy (page_snapshot_chunks, 1 MiB chunks) as a fallback if no blob store is configured.GET .../snapshot streams the blob with Content-Encoding: gzip (browser inflates natively; ETag = pageId:seq; revalidated on every load, since the URL serves the newest seq: ADR 0311), from a separate read pool. Then WS subscribe with sinceSeq. Tails come from the owner’s in-memory ring (<= 256 KB/room), else from Postgres (one read per room, shared by all waiting subscribers).FOR UPDATE SKIP LOCKED when its tail exceeds 20,000 ops or 4 MiB or 10 minutes of age, or when its room closes with a non-empty tail; stream snapshot + journal into a DocCore under a hard memory cap; write snapshot + structure; update pages.snapshot_seq and node_count; exit after N jobs or when RSS exceeds the cap.Row per node (millions of rows, write amplification), snapshot per change, journal-only (unbounded load time), zstd (browsers cannot inflate it via Content-Encoding everywhere; the codec column allows a later switch), write-behind with ack-before-commit (lower latency, but acknowledged edits could be lost).
Estimated sizes: ~15-20 B/node gzipped for snapshots (682K nodes ~12 MB), ~7 B/node for structure sections. Postgres stores mainly the journal; snapshots live in the blob store.