Writing

Building a Unified Data Layer in Crow

Several data systems share a pattern: durable writes feed queryable state. This is an account of how much of that machinery one single-node engine can share, using immutable batches, columnar segments and one programming language. It is held to the systems it stands beside, with its guarantees and its limits stated.

The data layer · written in Crow

The idea. Write each commit as one immutable batch file that is at once the durable record, a sorted segment with statistics and a word index, so it is queryable the moment it is on disk. Fold those files into larger columnar segments later. Let Crow's frame verbs be the engine. A table, a stream, an index and a view then differ only in how a log is keyed and read.

1 Why one data layer

A team that needs transactions, analytics, a stream, search and a cache usually runs a product for each, and the cost is not the products: it is the seams between them. Each has its own durability rule, so "is this write safe" has five answers. Each has its own clock, so a search index lags the table, a cache serves a value the table no longer holds, an analytics copy is minutes behind. Each has its own language and client, so the application carries five vocabularies and a layer of glue that moves rows between them, and that glue is where most of the outages live.

A layer built from one log, with one file shape, removes the seams rather than hiding them:

  • One durability rule. A write is durable when its file is on disk, and that is the only rule, for a transaction, a stream event and a bulk load alike.
  • One clock. A position in the log is the time. A query, a view, a search and a consumer all read "the state at position p", so nothing can be newer or older than it says, and there is no invalidation to design.
  • Queryable the moment it is durable. The file written at commit is already sorted, indexed and statistics-bearing. There is no pipeline from the store to the index or to the warehouse, because they are the same file.
  • One language. The program that writes the data queries it, with the same verbs it uses on any frame, and the page that shows it reads the same derivations. No SQL, no client library, no serialization at a boundary.
  • Nothing to keep in sync. The catalog, the search statistics, a replica and a backup are all functions of the directory's files. A copy of the files is a backup; a follower that holds the files is a replica; an upgrade is a reader that understands the format.
  • One process. On one machine with a working set that fits, the whole layer is a directory and a program, built and run as any Crow program is, in either of its modes.

What it gives up is specialization: the hash table Redis serves a key from, the B-tree Postgres finds a row through, the kernel ClickHouse has tuned for each aggregation. Section 7 states where that costs and section 8 what would close it. The rest of this article is the how: the architecture that follows from one file shape, a program using it, the guarantees it makes, and what a month of a trading app's data measured.

2 The example: finch

finch is the example project this layer is measured on: a trading app on one workstation. Its 1-second bars and NBBO quotes live in ClickHouse, about a month of them at a time; its datasets, metadata, news and scanner configuration live in Postgres; its pages are Crow views over derivations that query both. The deployment had grown 143,000 active parts in ClickHouse, and every question, however small, paid about 240 ms for it. A search over the news lived in neither database. Nothing was wrong with either product; the cost was in running two of them, with two durability models, two query languages and a page in front that had to know which held what.

The question this work asks is narrower than "replace the databases": how much of what the two of them do for finch can one process serve from one storage shape, written in the language the app is already written in, and what does it give up to do so. The answer is measured in section 6 and bounded in section 7.

3 The shared-batch architecture

Every durable store writes a row at least twice: as a log entry for durability and as a segment for reading, and a third time as postings when it is searchable. Those are three shapes, each cheap for one access pattern. This design writes one file that holds all three. A batch, whatever its writer gathered (a route's write set, a producer's message set, a day of bars), becomes one file. Its rows carry a position column, so it is a log entry a consumer reads in order. The rows are sorted by key inside the file with min, max and a bloom filter per column, so it is a level-0 segment a query reads with statistics. Its text columns get a token bloom filter and their counts in the same head, so it is a search index a query prunes by. One write, one flush, and the writer is told "done".

Group commit whatever arrived in a few ms one write one fsync Batch file N a position column: 1041 … 1163 rows sorted by key min, max and bloom per column token bloom for text columns a frame, written as Arrow IPC one file is the log, the segment, the index Consumer at a position reads files from N on, rows by position: streaming, CDC Query by key, scan with statistics skips files whose min, max or bloom exclude the key Search: token bloom, then scan term counts at scan time, document frequencies as statistics Merge in back many batch files → one sorted Parquet, filters merged later, when the program asks
One file written at commit serves the three readers; the merge is the only other write. In Crow the log is a sequence of frames on disk, a commit writes a frame with its statistics, and the merge is sort and concat over frames, then Parquet.

Four layers in one process. Amber is the log, the one component that must be correct from the first day, since everything else is a function of its files.

Front UI pages and HTTP routes use ui · JSON, Arrow IPC, CSV answers · both modes Kafka listener kafka.co over sys listen / accept · batch kernel Files and S3 csv · parquet · json · lines · put / fetch Crow programs Queries frame verbs over batches and segments, at a snapshot Transactions write set + versions read; validated in order, appended Views derivations run per batch file; their state is a frame Catalog a derivation of commit records; which files are current The log Batch files: one per commit, written once a frame with a position column, rows sorted by key, min/max and bloom per column, token filters for text at once the log entry, the level-0 segment and the search index · fsync grouped · read from any position a segment's head parsed once, its columns decoded across the cores · a snapshot is a position Store Merged Parquet segments many batch files → one sorted file, filters and counts in its head; immutable · the disk is the truth Manifest and backup the catalog is the directory's listing: the batches, and the segments that folded them a backup is the live files plus a manifest written last, to a directory or S3 Later A second node: a follower ships the leader's batch files (share / follow, Crow over the sys listener) · placement is a log per shard, named in the program · a query runs per shard and stacks with the same verbs · election not built read write append append directly, acked when on disk bulk load: one batch of any size, then a merge batches file names listing merge, when the program asks list scan at snapshot S log entries reads
A route's write becomes a transaction, which is validated and appended. A Kafka producer's event is appended directly. Every append lands in the next batch file, written once and fsynced once for everything committed in the same moment. The merge turns batch files into sorted Parquet segments in the background, and the catalog derivation lists what is current. A query scans the batch files and the segments at a snapshot, which is nothing more than a log position. A bulk load writes segments straight to the store and commits one manifest.

Read it from the amber band outward. Above it is everything that decides what gets written and what a reader may see: the Crow programs. Below it is the merge's output: the same rows in fewer, larger, sorted files. The front is thin, since Crow programs are the clients and existing Kafka producers are the only outsiders. A bug in the store is fixed by rebuilding it from the log. A bug in the log is data loss, so the batch writer is the first kernel written and the most tested.

The merge is the one other write. It folds many batch files, and segments already made, into one Parquet segment sorted by key, with the same statistics in its head, keeping the latest version of each key or every row when asked. It runs when the program calls it, not in the background: a program that wants it every few seconds schedules it. Level 0 is Arrow IPC rather than Parquet so a small commit pays no footer; the merge's output is Parquet, which is what a scan reads fastest.

Two words to fix. "The log" is a directory: a table, a topic and a consumer group's memberships are each a log with positions of its own, and there is no order across logs. "Crow" is the division of labour: per-byte work (the batch writer, the merge, the search kernel) is a runtime kernel in Rust; everything with protocol or policy (the sequencer, the catalog, the Kafka door, replication) is written in Crow, and the compiler is not touched.

The log replaces: WAL, Kafka, Lucene's translog, the memtable, replication stream, CDC

A numbered sequence of batch files, each a frame written as Arrow IPC with a position column, rows sorted by key, min, max and bloom filters per column, and token filters for text. An append is durable when its batch file has reached the disk. macOS needs F_FULLFSYNC to get past the drive's cache and it costs milliseconds, so a batch holds as many rows as its writer gathered: one flush per batch, a producer's whole set or a route's write set one batch. A log is a directory — a table, a topic, a group's memberships are each a log with positions of its own — so "the state at position p" is well-defined within a log, and a snapshot is a position.

The log serves five roles that are separate structures elsewhere: it is the write-ahead log, the level-0 segments, the search index of recent rows, the streaming substrate consumers read with offsets, and the change feed. Retention is a policy: a batch file can be deleted once the merge has folded it into a segment, or kept for replay. A segment's head is parsed once per process; a derivation over the log, re-derived when the fact it reads changes, is the cache.

The kernel is the batch writer. The Crow module lake.co is everything else: batch , since and tail , the sequencer, the search, the catalog's state, backup and restore, share and follow.

The store replaces: heap files, MergeTree parts, Lucene segments, Parquet files, Redis's memory

The merge reads many batch files and writes one Parquet segment sorted by the key, with Parquet's row-group statistics as the zone maps and the same filters, counts and token filters in its head, dropping overwritten versions (or keeping every row, for an append-only table); the files it folded are removed once the segment is in place. It runs when the program asks, over batches and segments alike, so a point read checks few unmerged files; levels are the program's policy. Point reads check the recent batches, then the files whose statistics admit the key. Range scans and aggregates read column chunks.

There is no container format to write. A segment is a Parquet file with its filters in its own metadata, and the directory's listing is the catalog. Nothing is edited in place, so a crash never corrupts a file, and a backup is a copy of the files plus a manifest. Crow writes and reads Parquet already; the new kernel is the merge.

Crow programs replaces: SQL planner, Spark, Flink, the catalog service, the transaction manager, Lucene's query layer

Queries are frame verbs. A query names a table and a snapshot position, and reads the recent batches and the segments as frames. Sort, group, join, window and mask are the operators, parallel through the core pool. A search is a verb too: token bloom filters prune the files that cannot hold a word, the candidate files are scanned, and BM25 ranks from the document and word counts every file's head keeps and the frequencies the scan counted. There is no SQL parser and no cost-based planner. The filters are pruning, not an index: a common word admits nearly every file, and when the scan's cost dominates, an inverted index beside the segment is the next step.

Transactions are one log entry each: the write set and the versions read. The sequencer takes transactions in order, validates each one's reads against the current state, and appends or refuses it. The guarantee it gives is stated in section 5. A transaction lives in one log, so data is split into logs by table or tenant.

Views are derivations, which Crow already caches by their inputs. A view follows the log: tail answers the rows past the position it last read, as they arrive; the view folds them into its state, and its state is a frame. Windows, joins and running aggregates are micro-batch, as Spark's streaming is, not per-event dataflow. A view's result written back to the log is a stream other views and other nodes can read.

The catalog is a derivation too. Its input is the log's directory, its state the list of batch files and segments with their positions and row counts ( batches ), a batch a segment folded marked stale; a backup's manifest is its checkpoint. Every file carries the schema it was written with and a merge takes files of one shape, so a schema change is a new log. Time travel is reading the state at an earlier position.

The front replaces: every wire protocol

Crow programs are the clients, so the front is small. HTTP routes answer JSON, Arrow IPC, CSV and msgpack already, in both modes, and the UI pages are Crow views over derivations. The Kafka protocol is the one outside door, because existing producers and consumers speak it: a kafka.co module over the sys layer's sockets, with listen and accept rows added beside send and recv , and a kernel for message sets. Files and S3 are the readers Crow has: CSV in one pass from bytes, Parquet, JSON, lines, put and fetch .

Postgres wire, RESP and Arrow Flight are not built. A door that holds state or makes decisions is a bug, since the behaviour would differ by door.

A second node replaces: the replication stream; not yet: ZooKeeper, each product's coordinator

A follower ships the leader's batch files: share serves the log's live files from one polling loop, follow fetches the ones the follower lacks, whole, and lets go of the batches a fetched segment covers. A file is written once and never changed, so the protocol needs no versions, no diffs and no locks, and a follower reads the log by position between passes as any log is read. Placement is a log per shard, named in the program; a query runs per shard and stacks the answers with the same frame verbs; a big join stays within a shard or broadcasts its small side. Election is not built: the leader is the one writer, and an operator promotes a follower. Raft over these two verbs, rebalancing, gossip and tenant quotas wait until a cluster asks for them.

4 The working example

The platform's log is a directory, here orders . A program writes frames into it as batches and reads them back with the verbs of use lake ; nothing is installed or configured beyond the directory, and the program runs the same interpreted ( crow run -i ) or compiled ( crow run ). One word to keep apart: log[x] in a Crow program prints x , as in every Crow program, and has nothing to do with the platform's log; below, "prints" is log[…] and "the orders directory" is the platform's log.

 use lake
use frame
 
--- the orders directory is the platform's log; log[x] below only prints x
first = batch['orders', frame.new[id = [1, 2], item = ['apples', 'pears'], note = ['a crate of apples for the shop', 'pears for the kitchen']], by = ['id'], texts = ['note']]
second = batch['orders', frame.new[id = [2, 3], item = ['pears', 'plums'], note = ['more pears', 'plums for the kitchen table']], by = ['id'], texts = ['note']]
log[latest['orders', ['id']]]
log[lookup['orders', 'id', '2'].note]
log[search['orders', 'note', ['kitchen'], 3].item]
log[since['orders', 2].item]
seg = merge['orders', by = ['id']]
log[batches['orders'].form]
log[metrics['orders'].rows] 

What it prints:

 id    item                  note  _pos
int     str                   str   int
--  ------  --------------------  ----
 1  apples  a crate of apples...     0
 2   pears            more pears     2
 3   plums  plums for the kit...     3
 
[3 rows x 4 cols]
['pears for the kitchen', 'more pears']
['pears', 'plums']
['pears', 'plums']
['segment']
[3] 

Each batch writes one file into the orders directory, once, sorted by id , with the words of note indexed; the position each row got is its _pos . The first line printed is latest : the table the directory holds, one row per key, the newest version of id 2 winning. lookup is a point read that opens only the files whose filters admit the key. search ranks the notes with BM25. since is a consumer: every row from a position on, which is what the Kafka door answers a fetch with. merge folds the files into one Parquet segment and the same reads go on working; batches is the catalog's state (one segment now) and metrics the directory's figures (three rows). A served page reads the same verbs in its derivations, and a second node copies the files with follow .

5 Commit, snapshot, compaction and recovery

There are three ways in. A transaction wants a conflict check before it is durable. A stream wants to be durable at once and in order. A bulk load wants to write a lot without a commit per row. All three end as files in the directory, so every reader uses one rule: it picks a position and sees the rows at or before it.

Transaction a route's write Stream producer events, CDC, metrics Bulk load files, backfills, imports Sequencer validate reads, in order commit The log batch 17 · 1041 – 1163 batch 18 · 1164 – 1290 batch 19 · 1291 – 1300 batch 20 · 1301 ← manifest … each batch a frame sorted by key, with its filters; one order for every write append append directly, acked when on disk Segment writer sorted, Parquet, sealed Store on disk segments land here first write Catalog add segments commit record Merge → segments Views each reads the batches and reports "applied ≤ p" Reader query at snapshot S S = log position 1301 read ≤ S which files are current at S
A transaction is validated, then appended. A stream event is appended, then acknowledged. A bulk load is one batch of any size, visible when its file is in place, folded into a segment by the next merge. A reader picks a position S and sees exactly the writes before it, in the batch files, the merged segments and the views alike, because they all follow the same order.

A transaction is validated, then appended ( commit ). A stream event is appended, then acknowledged ( batch , the Kafka door). A bulk load is a batch of any size, then a merge. A client that committed at position 1163 asks for a snapshot of at least 1163, and the file that holds it is already on disk, so the reader waits for nothing; a derivation's value carries the position it was computed at.

The transaction guarantee

commit[dir, f, seen, columns, equal] is optimistic and key-level. A transaction reads at snapshot seen , names the keys it read as column and value pairs (keys it looked for and did not find included), and hands its write set. The sequencer refuses the commit if any named key was written at a position after seen , by a commit or by a plain batch alike: streaming appends are writes like any other. Otherwise the write set lands as one batch, atomically. Concurrent writers are serialized by the file number: a writer claims the next number by linking its file into place; a name already taken makes it re-read the directory, validate again against what arrived, and try the next number. A write-write conflict is therefore a refusal of the later committer, which re-reads and retries, or gives up.

What this is and is not. For transactions that name every key they read, present or absent, it is serializable: no history can interleave two such commits in a way the key checks would miss. It does not validate predicates. Two bookings that each ask "does any booking overlap this interval" and name no key will both commit; to make them conflict, the program names the slots the interval covers as keys, one per unit of time, which is how a key-level check expresses a range. Uniqueness is the same: name the value as a key. A transaction spans one log; there is no commit across logs. Readers never block writers and writers never block readers.

Snapshots, compaction and replay

These cannot all hold forever once a merge folds versions, so each has its own rule:

Capability What a merge must keep What the lake does today
Current-state queries ( latest ) The latest version of each key Kept by every merge: the default folds older versions, and the answer is the same before and after
Historical snapshots ( scan[dir, upto] ) Every version a retained snapshot can see Exact until the first merge of a keyed log; after it, a snapshot before the merge's last position answers from the versions that survived, so a key whose only surviving version is later than the snapshot is absent. Exact at every position for a log merged with every = true , where nothing is folded
Complete replay ( since ) Every original row, or a lossless equivalent Exact for a log merged with every = true ; for a keyed log, a replay after a merge yields the surviving versions at their original positions, with gaps where versions were folded: Kafka's compacted-topic semantics, offsets stable, gaps documented
lookup and search — Both read every row present: every version before a merge, the surviving ones after. lookup['orders', 'id', '2'] answers two rows in the example and one after the merge; latest answers one either way
Rebuild from the files The files Every reader, the catalog included, is a function of the directory's files; nothing is kept elsewhere

A keyed log where every version matters is therefore merged with every = true , or not merged. The statistics a search ranks by count the rows present under the same rule. There is no delete verb; a program that needs one writes a tombstone row and reads around it, and a merge with the default folds it like any version.

Crash safety: the sequence

Immutability alone proves nothing; the writer's steps do. batch writes the frame to .<name>.part in the log's directory, flushes it ( F_FULLFSYNC on macOS, past the drive's cache), hard-links the part to its final name, which fails if the name exists, so a number taken by another writer is seen here, unlinks the part, flushes the directory so the name is durable, and only then answers the position. A merge publishes its segment the same way, and removes the batch files it folded only after the segment is in place.

On restart nothing is replayed, because nothing is held outside the files. A .part left by a crash has no batch's name and is never listed. A file cut anywhere inside its rows is refused by every reader with its reason (the runtime's tests cut a file at every byte), and such a file cannot carry a final name, since the name comes after the flush. A merge interrupted after its segment was placed but before its inputs were removed leaves batches a segment already holds; the catalog lists them as stale, readers skip them, and the next merge removes them. A crash after the name was placed but before the writer answered leaves a committed batch the client never heard of: a retried batch appends again (at-least-once, as a Kafka produce is), while a retried commit with the same snapshot and keys is refused, because its own earlier write is now a write after seen , so a committer that names its keys is exactly-once. What is tested: the cut file at every byte, the duplicate number, the stale batch after a merge, in both modes. What is not: a harness that kills the process between the steps above; that table is the next thing this section needs.

6 Measured results

Two comparisons, stated apart. The first is operational: finch's existing deployment against the lake, on the same month of data and finch's own questions. The second is controlled as far as one machine allows: Postgres given the month in a scratch database with the indexes the questions want, and the lake asked the same five questions from its files and over rows it holds. ClickHouse appears in both as finch runs it, with 143,000 active parts; that is a documented cause of slow queries in ClickHouse, so its column measures finch's deployment, not ClickHouse at its best. A controlled ClickHouse comparison, with the month loaded into a fresh table with comparable ordering and part counts, is the measurement this section still lacks.

Loading a month

One Crow program copied September 2026 out of ClickHouse and Postgres into the lake, a batch file per day, then merged each log into one segment with every row kept, since finch's bars are append-only and their keys are a sort order, not an identity (the month holds 2,173 duplicate keys, which the first merge had folded). The segment sizes are after the filters were sized by distinct values rather than rows, which halved them.

Step Rows Time Note
Bars out of ClickHouse, a batch a day 11,268,166 30 s 22 batch files sorted by day, symbol, time, with filters
NBBO out of ClickHouse 19,193,311 12 s the same shape
Postgres tables 16,538 under a second datasets, metadata, news, config
Merge of the bars into one segment 11,268,166 8 s Parquet, 8192-row groups, 336 MB; every row kept, sorted by day first
Merge of the NBBO 19,193,311 12 s 325 MB

finch's questions, answer for answer

finch's own queries against ClickHouse and Postgres, and the same questions as frame verbs over the lake. Every answer agrees. Times are one run each, warm, end to end from the program's call to the frame in hand, interpreted mode; the lake's work is in kernels either way.

finch query ClickHouse or Postgres The lake Agree
Shell chip: the last day and the count of symbols 973 ms 472 ms over the month in memory yes
A symbol's last, high and volume up to an instant 251 ms 4 ms, once the symbol's rows are read through the filters (364 ms for the month) yes
The tape: 1-minute candles with cumulative and 1-minute VWAP 235 ms 10 ms yes, 956 candles to 1e-6
The 3-minute closes RSI reads 225 ms 5 ms yes
The last close before an instant 239 ms 4 ms yes
The day's universe: datasets joined with metadata, filtered, newest per symbol 7 ms (Postgres) 11 ms yes, 42 rows
The scanner's rows_at: every gate column for the universe at an instant 327 ms 487 ms to read the day's 871,527 rows through the filters, then 49 ms 40 symbols, every gate alike; values alike at three decimals except ties, which ClickHouse rounds half to even

The benchmark

Five questions, five times each. "Cold" is the first run after the process starts; the operating system's page cache was not cleared, so a cold number includes the file's open and decode but not its disk. "Warm" is the median of the remaining four. "From the files" is a query that opens the segment at every call and includes its decode; "rows held" is the same question over a frame the process holds, as a served app holds a derivation, and measures the operators alone. Every number is end to end in the program, with no result serialization.

Question ClickHouse Postgres Lake, from the files Lake, rows held
A symbol's day as 1-minute candles with cumulative VWAP 260 / 225 41 / 17 38 / 18 2 / 3
A symbol's last, high and volume to an instant 240 / 226 18 / 8 34 / 16 2 / 1
The day's volume by symbol, top 20 268 / 244 81 / 37 55 / 34 2 / 3
The month's volume by day (11.3M rows) 590 / 573 333 / 303 367 / 327 22 / 21
The scanner's columns for the universe at an instant 379 / 330 293 / 249 161 / 129 94 / 94

What wins where. Over rows held, the lake answers four of the five questions in 1 to 3 ms, and the scanner's in 94. From the files, warm, it is faster than Postgres on the day's volume (34 against 37) and the scanner (129 against 249), within a millisecond on the candles (18 against 17), and slower on the point question (16 against 8) and on the month (327 against 303). Against finch's ClickHouse it is faster on every question, from the files and over rows held, by the fragmentation stated above. The point question loses because the lake decodes a row group of 8,192 rows where a B-tree reads one page; a key index per segment is the fix. The scanner's 94 ms is frame verbs over 871,527 rows (a join, masks, a sort, a group); the 49 ms in the table above is the same question at another instant over a day's rows read once, and the two were not run under one harness, which they should be.

Hypotheses, not measurements

The table below is what the structures involved suggest for workloads this machine has not run. Each row is a hypothesis to test, not a result. The Redis comparison depends on configuration: Redis acknowledges before the disk by default and can be told to flush first.

Workload The product This design Hypothesis to test What closes the gap
Point read (Redis) A hash table in memory, about a microsecond An in-memory index from key to batch and row over recent batches, then filters and a sparse index over segments Within a small factor The key index, built as batches are written, never persisted
Write latency (Redis) Acknowledged before the disk by default ( appendfsync everysec ); with appendfsync always it flushes first Acknowledged after a grouped F_FULLFSYNC , milliseconds on this machine 10 to 100 times slower by default A per-table option to acknowledge before the flush: Redis's latency with Redis's durability
Data structures (Redis) Skiplists, lists, hashes per element Frame verbs over small frames Slower per element Accepted; not this platform's job
Inserts and updates (Postgres) WAL, then heap and index pages in place One append per commit, merged later Faster —
Primary-key read (Postgres) A B-tree, microseconds from the buffer cache Recent batches by the key index, segments by bloom and a sparse primary index Near The sparse index per segment, as ClickHouse's primary index
Secondary-column lookup (Postgres) A B-tree on that column Bloom filters, then a scan Much slower on large tables A sorted projection: a second copy keyed by that column, one more write per row
Transactions per second (Postgres) Tens of thousands with group commit A single-threaded sequencer in compiled Crow validating read sets Tens of thousands Kernels for the read-set check if Crow's maps are the limit
Scans and the tuned verbs (ClickHouse) Its own format at gigabytes per second per core Parquet decode, then frame verbs that measured ahead of polars on load, sort, join, window and unique Within 2 to 3 times, DuckDB-over-Parquet's league Large row groups with dictionaries kept; a scan that never decodes columns it does not read
Specialized aggregations (ClickHouse) Approximate distinct counts, quantiles, group-by over many keys, hand-tuned The general frame verbs, some 3 to 30 times behind polars today Up to 10 times slower One kernel per aggregation, against ClickBench

7 Tradeoffs and what is not covered

Status, need by need. "Implemented and tested" means both modes under the repository's gate with an outside oracle; "limited validation" means the module's own tests only; "not implemented" means a stand-in or nothing.

Need Mechanism Layer Status
Durable storage Batch files written once at commit, merged Parquet segments behind them, S3 as the copy Log + store Implemented and tested
Streaming ingestion Append through the Kafka door or a route; acknowledged when the batch file is on disk; consumers read files by position Log + front Implemented and tested (kafka-python, both modes)
Batch ingestion One batch of any size, then a merge: the segment is what the merge writes, and the log carries the batch's positions Log + store Implemented and tested
Transactions One log entry with the write set and the versions read; validated in order by the sequencer Crow programs Implemented, limited validation (one writer at a time in the tests)
Cache Derivation results, each re-derived when the fact it reads changes and carrying the position it was computed at; a segment's head parsed once per process Views Implemented and tested (the served harness)
Point reads Recent batches first, then the files whose min, max or bloom admit the key Log + store Implemented and tested; the key index not implemented
Analytics Column chunks sorted by key, statistics pruning, frame verbs in parallel over the cores Store + queries Implemented and tested (finch, section 6)
Full-text and vector search Token filters pick the files, a scan counts the words, BM25 ranks ( search ); vectors are a column read into packages/vectors , beside the log Log + store + queries Search implemented and tested (parity 296); vectors in a package beside the log
Materialized and streaming views A view follows the log with tail , its state a frame; results written back with batch Views Implemented, limited validation (module test, book)
Change data capture Read the batch files from a position with a filter; the same consumer API as streams Log Implemented and tested
Backup, time travel, branching backup and restore : the live files plus a manifest written last; a snapshot is a position ( scan[dir, upto] ); a branch is a restore into another directory Lake Implemented, limited validation (a directory tested; S3 untested); snapshots lossy after a merge, section 5
Schema evolution Files carry the schema they were written with and a merge takes files of one shape; a schema change is a new log, read beside the old one by position Lake Not implemented: a schema change is a new log
Time series Time as the key, so batch files are already in order and the merge only concatenates; a policy downsamples old segments Store (a policy) Implemented and tested (finch's bars)
Replication and failover share and follow : a follower holds the same files; failover is an operator promoting a follower; election not built Second node Shipping implemented, limited validation (two processes); election and fencing not implemented

The Kafka door, exactly

"Speaks Kafka" is broad; this is what the door answers.

Kafka door Supported Not supported
Protocol The versions a 0.10.1 broker advertises; ApiVersions 0 to 4, so a modern client reads the ranges and speaks them Flexible versions past ApiVersions; SASL, TLS; any authentication
APIs ApiVersions, Metadata, Produce, Fetch (long-poll to max_wait_ms , at most 1,000 rows a fetch), ListOffsets, FindCoordinator, OffsetCommit, OffsetFetch, JoinGroup, SyncGroup, Heartbeat, LeaveGroup CreateTopics, DeleteTopics (a topic is made by its first use), DescribeGroups, transactions, idempotent producers
Records Legacy message sets, magic 0 and 1, CRC-32 checked; gzip and snappy decoded; text values Record batches (magic 2), lz4, zstd, headers; values that are not UTF-8 text
Topics One partition each; offsets are the log's positions; consumer groups of several members with rebalances Several partitions; retention and compaction policies (a topic grows until the program merges it)
Delivery A produce is acknowledged after its batch and the directory are flushed, whatever acks says; a client's retry is appended again Exactly-once; a produce is at-least-once on retry

Replication, exactly

share and follow ship files asynchronously: a follower holds a file after its next pass, whole or not at all, and a write the leader acknowledged is on the leader's disk alone until a follower fetches it. The durability boundary is therefore one disk; a leader's disk lost before the next pass loses the writes since it. Promotion is manual and there is no fencing: an operator who promotes a follower while the old leader still writes has two writers taking numbers independently, and nothing stops them. Election and fencing are not implemented.

Search, exactly

Token bloom filters prune files that cannot match; candidate files are still scanned. How well that works depends on the words' selectivity across files, on file size and the filters' false-positive rate, on the tokenization (runs of letters or digits, lowercased; no stemming, no phrases, no positions), and on whether the statistics count current rows or every version (they count the rows present, section 5). A common word admits nearly every file at any scale; an inverted index beside the segment becomes worthwhile when the scan's cost dominates, not at a document count.

What is not covered

The products this stands beside have, between them, seven layers and twenty-five parts. Holding this design to one way of doing each thing left four layers and eight parts. The rest is listed as not covered: each has a part that stands in for it today, and each can be added later as a file beside the segment, a module, or a door, without changing what exists.

The products: seven layers, 25 parts Covered: four layers, 8 parts Postgres wire · HTTP · RESP · Kafka · Flight · search API planner · executor (frame verbs) · distributed scheduler snapshots · catalog → a derivation · schema registry · sequencer the log → batch files that are also the segments and the index row store · column store · postings · memory store · views → derivations container format → Parquet · NVMe tier · object storage → backup gossip · placement → a log per shard · log shipping (second node) · rebalancing · quotas Front HTTP routes: JSON · Arrow IPC · CSV answers Kafka listener over sys listen / accept Crow programs queries are frame verbs · views are derivations over batch files the catalog is a derivation too, checkpointed to a manifest file The log one batch file per commit: positions, rows by key, filters sequencer validates a transaction's reads · a snapshot is a position Store merged Parquet segments with their filters · a manifest local disk is the truth · S3 is the backup, written with put merge
Struck parts are not covered yet, or folded into another. The right side is the whole single-node platform.
Not covered What stands in for it What adding it would bring
Row store, memory store, memtable The batch files are the level-0 segments; the cache is derivations over them Redis-grade point-write latency and its data structures; write-heavy OLTP at Postgres's level
Postings Token bloom filters in each file's statistics, then a scan; BM25 from the counts each file's head keeps and the frequencies the scan counts Search latency past hundreds of millions of documents, until an index file beside the segment is added
Container format Arrow IPC for a batch file, Parquet for a merged segment, the filters in each file's own metadata Nothing: Parquet and Arrow IPC are the formats
Catalog service, schema registry The directory's listing is the catalog; a backup's manifest is its checkpoint A catalog shared across machines, when a cluster needs one
Locks, isolation levels, two-phase commit A transaction is one log entry with its write set and the versions it read; the sequencer validates in order and appends Transactions across logs, which are refused today; split by table or tenant until then
SQL parser, cost-based planner Crow is the query language: frame verbs are the plan; a search verb reads the filters, everything else scans with statistics SQL clients, through a parser package over the same frame verbs
Postgres wire, RESP, Arrow Flight HTTP routes (JSON, Arrow IPC, CSV) and Kafka; Crow programs are the clients Existing drivers and tools, each a door of its own
Incremental dataflow Micro-batch: a derivation runs over each batch file as a frame, its state a frame Per-event latency, where a batch's worth is too slow
Shuffle, distributed scheduler A query runs per shard and merges with the same verbs; a big join stays in a shard or broadcasts its small side Arbitrary distributed joins across shards
Gossip, rebalancing, quotas Log shipping is the only coordination, and only with a second node; placement is a log per shard Elastic clusters: nodes joining and leaving, tenants limited
NVMe tier, object store as truth On one node the disk is the truth and S3 the backup A tiered store, for data larger than one node's disk

The one structural limit is the write path. Every commit is a file and a flush, so a workload of many small independent writes (a session store, a counter per request, row-at-a-time OLTP) pays milliseconds per write where Redis pays a microsecond. Batching writes in a door recovers most of it; a per-log option to acknowledge before the flush would recover the rest at Redis's default durability, and is not implemented. Everything else in the status table is work, not structure.