Acknowledgements
Ez az oldal a nucleus saját dokumentációjából készül, ezért angol nyelvű.
nucleus is its own design, written in its own code — but little in a
database is new, and much of nucleus stands on what other systems,
papers and libraries worked out first. This file credits them: what
idea was taken, from where, and where in nucleus it landed. These are
ideas (algorithms, layouts, a feature’s meaning), re-implemented
here, not code; the few files that did come from elsewhere are listed,
with their licences, in THIRD_PARTY.md.
Section ids (§M14.34 G3, …) point to the step in PLAN.md
where the borrowing, its measurements, and what was not taken are
recorded in full. New borrowings are added here as they are made
(CLAUDE.md, “Credit what is taken”).
PostgreSQL deserves a line of its own: beyond the ideas below, its answers and errors are the reference most of nucleus’s SQL tests are checked against.
SQL planner and optimizer
- PostgreSQL
CREATE STATISTICS— column-group distinct counts and functional dependencies in estimates. §M14.20 V12. - Yan & Larson, eager aggregation — grouping by the join key below the join. §M14.20 V13.
- Neumann & Kemper, “Unnesting Arbitrary Queries” (BTW 2015); Galindo-Legaria & Joshi, SQL Server’s Apply removal (SIGMOD 2001) — a scalar aggregate subquery rewritten as a grouped join. §M14.33 (
unnest). - Oracle 12c adaptive plans; SQL Server 2017 adaptive joins — hash join or index lookups chosen at run time at the cost model’s threshold. §M14.12 V3; §M14.34 G1.
- Oracle dynamic sampling, SQL Server sampled statistics, PostgreSQL’s default selectivities — estimates from a sample kept at
ANALYZE, PostgreSQL’s constants as the fallback. §M14.12 V3. - PostgreSQL
tsmatchsel/tsquery_opr_selec—@@selectivity from the text index’s exact counts. §M14.21. - PostgreSQL
plancache.c(and MySQL’s and Oracle’s shared cursors); Oracle’s soft parse — per-session plan cache keyed by text, invalidated with its relations. §M14.20 W8. - SQLite’s schema cookie — one counter bumped by every schema change, made snapshot-aware. §M14.20 W8.
- SQL Server’s and Oracle’s
COUNT(DISTINCT key)simplification —DISTINCTover a one-column primary key dropped. §M14.33 S12. - PostgreSQL InitPlan; SQL:1999
LATERALwith PostgreSQL 9.3’s meaning — an uncorrelated subquery evaluated once; a lateral join as a parameterized nested loop. §M14.12 V7.1. - PostgreSQL
make_sort_input_target— costly output expressions computed afterLIMIT. §M14.21 T8b. - PostgreSQL pathkeys; DuckDB’s and Umbra’s order properties — a sort skipped where the primary key’s order serves. §M14.27.
- PostgreSQL parallel
SubPlan;proparallel; HyPer / Umbra’s dependent join as a pipeline step — correlated subqueries and lateral functions run on the workers. §M14.20 W6; §M14.15 J3c. - PostgreSQL’s index access method API (
IndexAmRoutine) — the shape ofIndexMethod. §M14.12 V4b. - PostgreSQL expression indexes (
indexprs) — the expression’s text, type and columns kept in the index record. §M14.15 J4a. - PostgreSQL partitioned indexes and Merge Append; Elasticsearch per-shard statistics — BM25 statistics summed over a partitioned table. §M14.21 T8c; §M14.24 R3.
Recursive queries and graphs
- SQL:1999
SEARCH/CYCLE, as PostgreSQL 14 has them — written as the rewrite PostgreSQL’s documentation gives as their meaning. §M14.34 G2. - DuckDB’s
USING KEY(Hirn & Grust, “A Fix for the Fixation on Fixpoints”, CIDR 2023; DuckDB 2.0’s meaning) — a recursive query’s rows kept as a table by key. §M14.34 G3. - HyPer / Umbra’s iterations; Datalog engines and Soufflé — each round chooses its join by the rows the last one gave. §M14.34 G1.
- SQL/PGQ (ISO/IEC 9075-16:2023) —
CREATE PROPERTY GRAPH,GRAPH_TABLE, its patterns, labels and defaults, and what they mean. §M14.34 G4. - PostgreSQL 19 beta’s SQL/PGQ, as its documentation describes it —
GRAPH_TABLErewritten into joins, one per choice of element tables; matches as joins match. §M14.34 G4. - DuckPGQ (ten Wolde, Singh, Szárnyas & Boncz, CIDR 2023) — quantified edges,
ANY SHORTESTandpath_lengthover recursive SQL. §M14.34 G4.
Executor and vectorization
- Graefe’s Volcano — the first executor model. §M9.
- HyPer’s morsel-driven parallelism (Leis et al., SIGMOD 2014); DuckDB’s thread-local hash tables — pipelines over morsels on the workers, one table per worker. §M14.20 W6; §M14.33; the perf phase’s reads by key, step 2 (morsels sized by a row’s cost: two leaves for a pipeline of lookups).
- Kuiper et al., “Robust External Hash Aggregation in the Solid State Age” (ICDE 2024, DuckDB); ClickHouse two-level tables — one memory bound for an aggregate, groups spilled by hash parts. §M14.20 W6.
- DuckDB’s salted hash table and perfect hashing; ClickHouse two-level tables —
keytable. §M14.20 V13. - DuckDB join-filter pushdown — a hash join’s key range, list or Bloom filter narrowing the probe side’s scans. §M14.20 V13.
- Chen & Ailamaki, prefetching in hash probes — a batch’s lookups done before its output. §M14.20 V13.
- Expression templates (numeric libraries) — decimal arithmetic fused over typed vectors. §M14.20 V13.
- DataFusion
GroupsAccumulator; ClickHousesizeOfData— typed per-group state, counted againstwork_mem. §M14.20 W6. - Calcite
AggregateExpandDistinctAggregatesRule; SparkRewriteDistinctAggregates; DuckDB’s and ClickHouse’s lone distinct aggregate —DISTINCTaggregates as two groupings. §M14.20 W6; §M14.33 S1. - PostgreSQL’s bounded (top-N) sort — a heap below
LIMIT. §M14.20 W6. - Normalized sort keys (System R; Raasveldt, DuckDB, 2021); PostgreSQL abbreviated keys — keys compared as bytes, an 8-byte prefix as a number. §M14.20 W2/W6; §M14.27.
- Merge Path (Odeh, Green, Mwassi, Shmueli & Birk, IPDPS 2012); DuckDB’s parallel merge sort — merges split by key range. §M14.27.
- LSD radix sort (ClickHouse
RadixSort.h, DuckDB), pdqsort beyond it. §M14.27 S8a. - Late materialization (Velox lazy vectors; DuckDB’s and ClickHouse’s
PREWHERE) — filter columns first, the rest for rows kept. §M14.33. - PostgreSQL
ExecQual; DuckDB and Velox selection vectors — conjunctions a term at a time. §M14.33 issue #2. - DuckDB’s probe that yields a vector and keeps its place — a hash join’s output not held whole. §M14.33.
- LLVM hot/cold splitting — cold paths of
Expr::evaloutlined. §M14.20 W6. - DuckDB’s parallel CSV reader; “Instant Loading” —
COPYparsed in parallel, overlapped with storing. §M14.20 W3. - PostgreSQL bitmap heap scans; Lucene
advance— found keys sorted, the table read once in their order. §M14.21 T5a.
Storage: KV, B+tree, LSM, branches
- FoundationDB; CockroachDB and TiDB — SQL and other layers on an ordered transactional KV. Principle 1.
- LMDB and copy-on-write B-trees — a copy-on-write B+tree with logical redo; checkpoints frozen per epoch. §M4; §M14.20 W4.
- LeanStore key heads (Leis et al., ICDE 2018) — four key bytes in each slot, searched as integers. §M14.33 issue #1.
- Big-reader locks (Linux
brlock, per-CPU rw-semaphores) and BRAVO (Dice & Kogan, USENIX ATC 2019) — a reader lock a stripe, a writer taking every stripe:striped::Striped, the store’s tree lock. Perf phase, point reads. - Optimistic, version-checked reads (LeanStore, Leis et al., ICDE 2018; Umbra’s versioned latches) — a page read without its latch, checked by a version: in safe Rust as a thread’s copy of a tree’s root, good while its frame’s owner and version are unchanged (
BufferPool::read_copy). Perf phase, point reads. - Bayer & Unterauer, prefix B-trees (1977); Graefe, Modern B-Tree Techniques — a node’s shared prefix stored once. §M14.20 V5.
- Chen, Gibbons & Mowry, pB+-trees (SIGMOD 2001) — a leaf’s cache lines touched together. §M14.33 issue #1.
- Group prefetching (Chen, Ailamaki, Gibbons & Mowry, ICDE 2004); AMAC (Kocberber, Falsafi & Grot, VLDB 2015); MySQL MRR —
BTree::seek_group. §M14.33 issue #1. - PostgreSQL
io_combine_limit— runs of pages read into one buffer. §M14.33. - PostgreSQL
nbtsort— sorted bulk loads packed into leaves. §M14.20 W2. - PostgreSQL’s and SQLite’s file extension ahead of writes — §M14.20 W7.
- PostgreSQL
heap_deform_tupleandattcacheoff; SQLite serial types — row decoding by fixed lengths and cached offsets. §M14.20 W7; §M14.33 issue #2. - SQLite overflow chains; PostgreSQL per-type
STORAGE— large values kept with their row. §M14.12 V7.2. - PostgreSQL
wal_level = minimal/COPY FREEZE; CockroachDBAddSSTable— bulk loads into fresh ranges skip the WAL. D16; §M14.20 W4. - PostgreSQL’s checkpointer — sorted buffer writes under a share lock. §M14.20 W4.
fdatasync(PostgreSQL’s and SQLite’s default); AppleF_FULLFSYNC/ SQLitefullfsync— the sync policy. D17; §M14.28.- ARIES redo by page; PostgreSQL recovery prefetch — replayed writes applied sorted by key. §M14.28 issue #14.
- O’Neil, Cheng, Gawlick & O’Neil, “The Log-Structured Merge-Tree” (1996); LevelDB and RocksDB — the LSM engine: column families on one WAL, ingested runs, range deletions, rate limiting, the block cache, compaction filters, version edits. §M14.28.
- Dostoevsky (Dayan & Idreos, SIGMOD 2018); Cassandra 5’s Unified Compaction Strategy — one parameterized merge policy, lazy leveling. §M14.28 L2.
- RocksDB’s
CompactRange(a manual full compaction) — the erasure’s merge of an LSM tree’s runs into one, tombstones dropped, the old files zeroed before removal. §M14.24 R2b, issue #26. - Apache Parquet’s split-block Bloom filter — per-run filters. §M14.28 L2.
- bLSM (Sears & Ramakrishnan, SIGMOD 2012); MyRocks (Matsunobu, Dong & Lee, VLDB 2020); WiredTiger’s and CockroachDB’s LSM histories; the RUM conjecture (Athanassoulis et al., EDBT 2016) — merge scheduling, and the engine chosen per table. §M14.28.
- ZFS births and dead lists — copy-on-write branches in one file. §M14.13.
- ZFS / btrfs
send; CockroachDB incremental backups — incremental backups by birth. §M14.18 O3. - Harris’s economic order quantity (1913) — index fold and seal sizes chosen by cost. §M14.12 V4; §M14.21.
- CLOCK eviction — the buffer pool and the LSM block cache. §M2; §M14.28.
- TinyLFU’s doorkeeper (Einziger, Friedman & Manes, 2017) — a query kept in the plan cache the second time it is seen. §M14.20 W8.
Transactions, time travel and testing
- FoundationDB’s read-conflict check — serializable isolation by read-set validation. D12.
- FoundationDB’s and TigerBeetle’s deterministic simulation — I/O, time and randomness behind a seeded simulator. Principle 4.
- PostgreSQL commit timestamps; CockroachDB
AS OF SYSTEM TIME; Oracle and Snowflake per-tableAS OF; SQL:2011FOR SYSTEM_TIME— time travel. §M14.14. - Jepsen’s Elle (Kingsbury & Alvaro, VLDB 2020); Adya’s anomalies; elle-cli — the list-append checks in CI. §M14.29 S5.
- SQLancer (Rigger & Su): differential testing, TLP, NoREC — the bug hunt. §M14.33.
- SQLite’s sqllogictest format — the test kit’s scripts. §M9.
- libFuzzer / cargo-fuzz; SQLite’s
dbsqlfuzz— fuzzing in CI. §M14.29 S2. - SQLite
SQLITE_MAX_EXPR_DEPTH; DuckDBmax_expression_depth— expression depth bounded. §M14.29 S2. - Benchmarking method: Raasveldt, Holanda, Gubner & Mühleisen, “Fair Benchmarking Considered Difficult” (DBTest 2018); Georges, Buytaert & Eeckhout (OOPSLA 2007); Mytkowicz et al. (ASPLOS 2009); Uta et al. (NSDI 2020); Kalibera & Jones (ISMM 2013); pyperf and hyperfine — §M14.31; §M27.
- YCSB’s scrambled Zipfian — LSM read workloads. §M14.28 L5.
- PostgreSQL’s subtransactions; InnoDB’s undo records by savepoint — savepoints as an undo note per savepoint, kept per key. Issue #24.
- PostgreSQL’s logical decoding, its reorder buffer, replication slots and
restart_lsn(as its documentation describes them); MySQL’s row-based binary log; Debezium — replicas follow the primary’s WAL decoded into commits (a spilled transaction’s intents gathered until its commit), slots holding the log, where decoding starts again. Written fresh innucleus_txn::decodeand the WAL’s hold. §M17.5 R1 (D25); the reorder buffer’s spilling of the largest transaction pastlogical_decoding_work_mem, as runs merged at the commit, §M17.5 R7. - MySQL’s semi-synchronous replication (
AFTER_SYNC), PostgreSQL’ssynchronous_standby_names(ANY k) andsynchronous_commit = local; CockroachDB’s causality tokens, PostgreSQL 19’sWAIT FOR LSN, MySQL’sWAIT_FOR_EXECUTED_GTID_SET(from their documentation) — a commit visible and answered oncekreplicas have it, the server’s own records not waiting; a commit’s timestamp as a token a replica waits for. Written fresh in the engine’s visibility gate,nucleus_server::replicationandnc_wait_commit. §M17.5 R3. - Viewstamped Replication’s view numbers, Raft’s terms, PostgreSQL’s timelines and
pg_promote; Martin Kleppmann’s fencing tokens (from the papers and documentation) — a promotion starts a new epoch kept in the database with where its history forks; a primary of an older epoch steps down, a replica past the fork is seeded again. Written fresh innucleus_server::replication(Replica::promote,nc_promote(),nucleus promote). §M17.5 R4. - PostgreSQL 17’s failover slots (
sync_replication_slots) and its system identifier (from its documentation) — a replica keeps its primary’s other slots with its own log held for them, so they follow it once promoted; a database’s identity refuses a replica of another. Written fresh innucleus_server::replication. §M17.5 R4b. - Raft (Ongaro and Ousterhout; the thesis’s pre-vote and leader leases), MongoDB’s replica-set elections and arbiters, Patroni’s leader lease (from their papers and documentation) — automatic failover: one vote per epoch for an up-to-date candidate (its last commit’s epoch first, then the commit: Raft’s last log term, then index), never within a lease of hearing from the primary, a pre-vote first; a primary writing only under a majority’s lease; a witness that only votes. Written fresh in
nucleus_server::cluster. §M17.5 R4c. - libpq’s multi-host connection strings,
target_session_attrsandload_balance_hosts; pgjdbc’stargetServerType; the MongoDB drivers’ server selection, retryable writes and causal sessions (from their documentation) — a client naming several servers settles on the one its target asks for by the role the Welcome gives, reruns a statement a former primary refused on the new one, and keeps the commit token each Ready brings. Written fresh innucleus_clientand the drivers. §M17.5 R5. - libpq’s SIGPIPE handling (its documentation and the technique as known:
MSG_NOSIGNAL,SO_NOSIGPIPE, and around an SSL writeSIGPIPEblocked then a pending one taken back withsigtimedwait) — a write to a server that died ends no program using the C driver. Written fresh indrivers/c/nucleus.c. §M17.5 R5b. - PostgreSQL’s
pg_stat_replication,pg_replication_slots,max_slot_wal_keep_sizeandpg_drop_replication_slot; MySQL’sSHOW REPLICA STATUS; MongoDB’srs.status(); Patroni’spatronictl listand REST health checks (/primary,/replica?lag=); postgres_exporter users’ alert rules (from their documentation) — a cluster’s metrics, the slots’ cap,nucleus cluster status, the checks a load balancer polls, alert rules. Written fresh innucleus_server::replication,nucleus_server::cluster,modules/prometheus,nucleus cluster statusanddocs/alerts/replication.yml. §M17.5 R6. - Raft’s CheckQuorum and leader leases (Ongaro’s thesis), etcd’s and CockroachDB’s lease-on-the-clock checks; PostgreSQL’s
LagTrackerandpg_last_xact_replay_timestamp(); Patroni’s rejoin of a former primary (pg_rewindor reinitialization); Jepsen’s nemeses — partitions, pauses, late links (from their documentation and papers) — a lease’s end enforced by the engine, a primary without its lease backing off, the replicas’ lag in seconds,--rejoin, the chaos tests. Written fresh innucleus_txn::engine,nucleus_server::cluster,nucleus_server::replicationandcrates/server/tests/cluster.rs. §M17.5 R7. - PostgreSQL’s sequences (
SEQ_LOG_VALS, values logged ahead and skipped after a crash); Oracle’s sequenceCACHE— a sequence’s value outside transactions, a reservation written ahead and grown while it is fast. Issue #23. - CockroachDB’s ranges, meta2 records keyed by end key and
DistSender; TiKV’s region epoch andEpochNotMatch; Bigtable’s METADATA rows keyed by end row (Chang et al., OSDI 2006) (from their documentation and papers) — the keyspace cut into ranges: descriptors as keys under each range’s end key with a generation, a router’s location cache corrected by a server’s refusal, scans cut at range ends; splits and merges as transactions over descriptors (the left keeping its id, a sticky start kept from merges). Written fresh innucleus_range. §M18 S1 (D26). - CockroachDB’s
ALTER TABLE … SPLIT AT/UNSPLIT AT/UNSPLIT ALLand its sticky splits; its splits at table boundaries; MongoDB’s indivisible (“jumbo”) chunks (from their documentation) — manual splits kept from merges, ranges ending at tables’ starts, units a split may not cut (a row’s long values’ chunks, a column segment’s columns). Written fresh innucleus_sql::rangesandnucleus_range. §M18 S2. - TiKV’s split checker and approximate region sizes, PD’s merges of small regions (TiDB’s documentation: 256 MiB regions); CockroachDB’s
range_max_bytes/range_min_bytesand merge queue; FoundationDB’s data distributor’s sampled shard sizes (design/data-distributor-internals.md) (from their documentation) — sizes estimated periodically from the store’s indexes, not counted on a commit; splits past a size, merges well below it (hysteresis). Written fresh inBTree::approx_bytes, the LSM engine’sapprox_bytesandRangeStore::balance. §M18 S3. - CockroachDB’s load-based splitting (its documentation:
kv.range_split.load_qps_threshold, balance and few requests crossing the split, a clear direction refused,by_load_merge_delay) and TiKV’s load base split; chains-on-chains partitioning (Pınar and Aykanat, JPDC 2004); reservoir sampling (Vitter, ACM TOMS 1985); Spanner’s hot rows isolated (its documentation) — load counted per range, requests sampled while hot, a split intokparts at once with the least heaviest part, the refusals, a hold from merges. Written fresh innucleus_range::loadandRangeStore::balance. §M18 S4. - Branch-free binary search (Khuong and Morin, “Array Layouts for Comparison-Based Searching”, ACM JEA 2017); poor man’s normalized keys (Graefe, Modern B-Tree Techniques, 2011); RCU’s publish-then-announce (Linux); Java’s
LongAdderstriped counters — the router’s view of the ranges: ends as words past their common prefix searched without branches, a new view published before the epoch that announces it, a thread’s view checked by one load, reference counts and request counters striped by thread. Written fresh innucleus_range::store::ViewandRangedTxn::route_in. §M18 S5. - Raft (Ongaro and Ousterhout, USENIX ATC 2014) and Ongaro’s thesis (pre-vote, CheckQuorum); etcd’s raft library (its documentation: the protocol as a state machine handing out a
Ready,findConflictByTerm, probing and replicating followers); FoundationDB’s and TigerBeetle’s deterministic simulation (their documentation and the FoundationDB paper, SIGMOD 2021) — the protocol, its interface, and the simulator of nodes that tests it. Written fresh innucleus_raft. §M19 R1. - TiKV’s batch system (its documentation and blog: one write and one sync a round for every Raft group of a node); Raft’s snapshots and log compaction (the paper, §7; Ongaro’s thesis, ch. 5) —
LogStoreandRaft::compact, written fresh innucleus_raft. §M19 R2. - Raft’s joint consensus (the paper, §6) and Ongaro’s thesis, ch. 4 (membership in effect once in the log, learners catching up, a removed leader stepping down, a removed member standing until its removal commits) —
Raft::change_membership, written fresh innucleus_raft. §M19 R3. - Ongaro’s thesis, §6.3–§6.4 (client sessions; ReadIndex and lease reads); Wing and Gong (1993) and Lowe (2017) for the linearizability search, Horn and Kroening (FORTE 2015) for checking it key by key (P-compositionality), as Porcupine applies it (its documentation) —
Raft::read_index,Raft::lease_read,nucleus_raft::kvandnucleus_raft::linearizable, written fresh. §M19 R4. - CockroachDB’s coalesced heartbeats and quiescence (“Scaling Raft”, 2015; its replication-layer documentation) and TiKV’s hibernate regions (its documentation) —
nucleus_raft::multi::MultiNode(one packet a destination a round, idle groups quiesced), written fresh. §M19 R5a. - CockroachDB’s range splits and merges (its documentation and design notes: the split trigger, the initial log index, subsume and the frozen right-hand range, the replica GC queue) —
nucleus_raft::range(ranges as groups, splits and merges as log commands, the overlap rule for snapshots), written fresh; merges here carry the frozen state instead of requiring colocated, caught-up replicas. §M19 R5b. - CockroachDB’s range-ID-local keys (the applied state and the range tombstone beside a range’s data), its split trigger clearing the right-hand data of a replica destroyed before it (its documentation and design notes) — a range’s state on the node’s store, applied with its writes in one transaction, removed with a tombstone. Written fresh in
nucleus_raft::range. §M19 R6a. - CockroachDB’s range merges with colocated replicas (its documentation and the merge RFC: the right-hand range subsumed and frozen, the wait for every replica to apply it, the replica GC sparing a right-hand replica its left-hand one has yet to merge, snapshots made when sent and subsuming replicas when applied) — merges with the keys in place and fresh snapshots. Written fresh in
nucleus_raft::range,Raft::send_snapshotsand the simulator. §M19 R6b. - TiKV’s placement driver (its documentation: store and region heartbeats, operators carried out by region leaders), YugabyteDB’s master, Kafka’s KRaft controller (KIP-500: the controller as the leader of a metadata log), FoundationDB’s random process UIDs (its documentation) — a placement driver as the leader of the system range, nodes’ heartbeats with the ranges they lead, ids chosen by the node, splits and merges through a recorded intent. Written fresh in
nucleus_raft::driverandnucleus_raft::node. §M20 C2 (D28). - CockroachDB’s allocator and zone configurations (its documentation: replicas ranked by constraints, then locality diversity, then range counts; dead nodes after
server.time_until_store_dead; decommissioning; merges aborted when a replica cannot take part); TiKV’s PD operators (its documentation: add a learner, promote, remove, carried out by the region’s leader); etcd’s WAL (its documentation: entries saved before the hard state) — rules, placement and decommissioning innucleus_raft::driver, the merge given up byAdmin::Unfreeze, andLogStorewriting a round’s entries before its hard state. Written fresh. §M20 C3. - TiKV’s PD removing a store’s stale peers, and CockroachDB’s replica GC queue (their documentation and design notes); CockroachDB’s allocator rebalancing for diversity; CockroachDB’s store liveness (each node’s view of its peers); Raft’s thesis §4.2.3 on removed servers disrupting elections — collecting members removed while their node was away (orphans reported, dropped once the range’s leader reports them no member), a forgotten member keeping its term and vote and voting for no one until a snapshot, spreading swaps, silence measured by every node and carried to a new driver, in
nucleus_raft::driverandnode. Written fresh. §M20 C4b. - Raft’s thesis §4.2.1 (a new server caught up in rounds); CockroachDB keeping its gossip’s addresses on disk (its documentation) —
Raft::caught_upby rounds, and a node’speersfile asked after a restart, innucleus_raft::coreandnucleus_server::kvnode. Written fresh. §M20 C5.
Compression and encodings
- LZ4’s block format, its decoder’s wild copy and compressor’s match extension — the
lzcodec. §M14.20 V5/W7; §M14.28 L4b. - Apache Arrow’s layout; DuckDB’s and ClickHouse’s column writers — columnar results and segments. §M14.11; §M14.20 W3b.
- ClickHouse’s sparse primary index (marks) — point lookups in column tables. §M14.20 W6.
- DuckDB’s decimal widths — decimals stored in 6 or 10 bytes. §M14.33 issue #2.
- xxHash64 (Collet) — the stable sketch hash. §M14.27 S6.
- CRC-32C: Adler’s
crc32c.c; Intel’s iSCSI CRC paper (2011) — three interleaved streams. §M14.20 W5. - SplitMix64 (Steele, Lea & Flood, 2014); FNV-1a — generators and ids.
Text search (§M14.21)
- Lucene and Tantivy — 128-posting bit-packed blocks, tiered merges, delete bitsets, indexing threads. T3–T5b.
- SQLite FTS5 — tombstones in newer segments, the trigram analyzer,
highlight(). T1, T4, T6. - PostgreSQL’s GIN pending list — upkeep done by the writers (HNSW too). T4.
- Lucene
BM25Similarity; Kamphuis, de Vries, Boytsov & Lin (ECIR 2020) — scoring with exact lengths. T5. - Turtle & Flood’s MaxScore (1995) as Lucene 10’s
MaxScoreBulkScorer; Ding & Suel’s block-max bounds (SIGIR 2011); PISA’s and JASS’s quantized sums — windowed block-max MaxScore. T5b. - Lucene’s query syntax and
SloppyPhraseMatcher; Tantivy’s split-word phrases — T2, T6. - Lucene
ScoreDoc, Elasticsearch_score, ParadeDBpdb.score— the score as a column. T5c. - UAX #29 word breaking; Porter (1980); Lucene’s
EnglishAnalyzer; Snowball 3.0.1 — analyzers. T1. - Reciprocal rank fusion (Cormack, Clarke & Büttcher, SIGIR 2009); convex fusion (Bruch, Gai & Ingber, TOIS 2024) — T7a.
- Elasticsearch
sparse_vector, OpenSearch neural sparse; SPLADE (Formal et al., 2021) — the sparse index. T7b. - PostgreSQL
tsvector_op.c,tsrank.c,ts_headline— reproduced in pg-compat. T8. - Anserini and BEIR — the reference baselines. T5.
Vector search (§M14.12)
- HNSW (Malkov & Yashunin, 2018); hnswlib’s neighbour heuristic — V4.
- ParlayANN batch inserts (Manohar et al., 2024); NN-descent’s local join (Dong et al., 2011) — V4.
- FreshDiskANN (Singh et al., 2021) — a fixed graph beside a fresh delta; delete consolidation. V4.
- Bentley & Saxe’s logarithmic method (1980) — patch levels merged. V4b.
- pgvector — the
vector/sparsevectypes, operators, limits and operator classes; iterative widening and scans. V1–V6b. - Lucene’s exact fallback under a filter; Weaviate
flatSearchCutoff; ACORN (Patel et al., 2024) — filtered search. V5. - Milvus partition keys; Weaviate and Qdrant tenants — one graph per tenant. V5.
- Qdrant, Elasticsearch and Weaviate rescoring; Lucene’s int8 corrective terms; FAISS and USearch codecs — quantized graphs. V6a.
JSON and documents
- The Variant format (Spark, Delta, Iceberg, Parquet); MySQL’s binary JSON — node headers and per-container offset widths. §M14.15 J1.
- RFC 8785 (JCS) numbers; RFC 8259 / I-JSON — J1.
- PostgreSQL’s
jsonpathgrammar and executor — SQL/JSON paths. J3a. - PostgreSQL GIN
jsonb_path_opsandjsonb_ops— the containment index. J4b. - pg_jsonschema’s names; the
jsonschemacrate’s compiled keywords — schema checks. J5. - PostgreSQL
jsonb_extract_path— a->chain fused. §M15 D1. - PostgreSQL
INSERT … ON CONFLICT(its documentation) — the upsert’s form and meaning: arbiters inferred from a key’s parts,excluded, a row affected twice refused (21000), the update policy’sUSINGan error. §M15 D2. - MongoDB (its documentation) — a collection’s shape: every document keyed by
_id, one made where absent, any id but an array; a collection’s JSON Schema validator (WITH (schema = …)). §M15 D3; dotted paths naming an index’s fields (CREATE INDEX ON c (a.b.c)). §M15 D4. Its multikey index (an entry per array element, a field’s array expanded) and MySQL’s multi-valued index (its documentation): §M15 D5. Its query filter documents — the operators and their matching rules (arrays unwrapped, no comparison across types), which SQL/JSON’s lax mode (SQL:2016; PostgreSQL’sjsonpath) shares — chosen as nucleus’s filter front end, compiled to lax path predicates: §M16 (D22). Its update operators ($set…$pushwith$each/$position/$sort/$slice,$pullby a condition), upserts, projections ($slice) and its sort order (the order of types, arrays by their least or greatest element, keys generated as a compound multikey index’s, parallel arrays refused), as its documentation describes them and MongoDB 8 answers: §M16 Q3 (json::document). - MongoDB
_idrules and multikey indexes; MySQL multi-valued indexes; Oracle 23ai JSON collections; DocumentDB / FerretDB — the collection design. §M15. - MongoDB’s wire protocol and its specifications (its documentation; bsonspec.org’s BSON 1.1; the Extended JSON v2 and driver handshake / SCRAM-SHA-256 authentication specifications) —
OP_MSGwith document sequences, theOP_QUERYhelloandOP_REPLY, the commands and replies drivers andmongoshexchange, BSON’s encoding, Extended JSON’s wrappers ($oid,$date,$numberDecimal,$binary),saslStart/saslContinue, the error codes drivers act on (11000 a duplicate key). Written fresh inmodules/mongo-compat. §M16 Q5. - Apache Kafka (its documentation and design: the log, offsets, consumer groups and their committed positions); FoundationDB’s versionstamps (keys and values completed by the commit); the transactional outbox pattern and Debezium’s change events; PostgreSQL’s logical decoding — a stream as an append-only table whose
seqthe commit gives (dense and in commit order, where versionstamps are ordered but not dense), the commit filling the row’sseqandtime, consumer groups whose position moves in the consumer’s transaction. Written fresh innucleus_txn(Transaction::append) andcrate::stream. §M16.5 S1–S2 (D23). - CockroachDB’s changefeeds (
CREATE CHANGEFEED, its documentation) and Debezium’s change events (op,key,before,after) — a changefeed as a stream that the table’s writes append to in their own transaction, its entry’s shape. Written fresh incrate::changefeed. §M16.5 S3. - Amazon SQS (visibility timeouts, receive counts, redrive to a dead-letter queue), pgmq, River and graphile-worker (their documentation: priorities, attempts, exponential backoff, a job finished in its work’s transaction); PostgreSQL’s pathkeys (an index scan providing an ordering) — a queue as a table whose lease is
available_atmoved past it, taken in a short transaction and finished in the work’s, dead letters to a stream; the secondary index’s order dropping a sort. Written fresh incrate::queueandoptimizer::key_order. §M16.5 S5. - JSON Lines / NDJSON (one JSON value a line); Apache Kafka (its documentation:
OFFSET_OUT_OF_RANGEand the consumer’s reset policy); FIX (heartbeats, resend requests by sequence number) — the sample adapter’s line protocol, a gap named with where the stream begins and the choice left to the reader, a heartbeat on an idle subscription. Written fresh incrate::adaptersandmodules/ndjson. §M16.5 S6. - Materialize’s and RisingWave’s
SUBSCRIBE(their documentation:(timestamp, diff, row…)batches); Convex (invalidation by a query’s read set); Hasura (polling and diffing a subscribed query) — live queries: a watch of the key ranges a query read, raised at commit; the query run again at a new snapshot and its multiset diffed, answered as(nc_ts, nc_diff, columns…). Written fresh innucleus_txn::Engine::watch_writesandcrate::live. §M16.6 S1–S2. - Hasura’s multiplexed subscriptions (its documentation); Blakeley, Larson and Tompa, “Efficiently Updating Materialized Views” (SIGMOD 1986) — a live query’s run shared by the subscriptions with the same query, parameters and identity; a select-project query kept current by the rows a commit wrote alone, read by key and filtered and projected, in place of a run. Written fresh in
crate::liveandnucleus_txn::Engine::watch_writes_keyed. §M16.6 S4. - ElectricSQL’s shapes (their documentation: one table, a
WHERE, an offset to resume from, a refetch when it is gone); Kulkarni, Demirbas, Madappa, Avva and Leone, “Logical Physical Clocks” (hybrid logical clocks, 2014) — a sync shape as one table’s rows a query selects, its changes since a device’s position read as the shape at that commit against now (time travel), sent whole when the history no longer reaches it; the server’s clock never below the last given or seen. Written fresh incrate::sync. §M16.7 Y1. - Replicache’s and Zero’s client mutation ids (their documentation: the last mutation applied, kept per client); Realm’s compensating writes (its documentation) — a device’s writes numbered and applied exactly once by the server, which keeps the last one applied per user and device in the writes’ own transaction; each write answered with its row as the server holds it, so a refused write is undone on the device. Written fresh in
crate::sync. §M16.7 Y2. - cr-sqlite (its documentation: last writer wins by clocks, with deletes kept as tombstones); CouchDB’s and Automerge’s custom conflict resolution (their documentation) — a table’s sync rule: the last writer by
(clock, device), each row’s clock kept under a reserved index and set by every write, a delete kept as a tombstone; or a module’s merge function deciding a conflict. Written fresh incrate::sync. §M16.7 Y3. - Firestore’s latency compensation (its documentation: local writes seen at once, as pending writes); Replicache’s rebase of pending mutations (its documentation) — a device reads its own writes at once; an answer applied on the device skips every row a write still unanswered changed, so no answer undoes a newer local write, and the write’s own answer brings the server’s row. Written fresh in
crate::sync::device. §M16.7 Y4. - Kerberos’s allowed clock skew (5 minutes, RFC 4120); CockroachDB’s maximum clock offset (its documentation) — the server’s hybrid logical clock takes a device’s clock only up to 5 minutes past its wall clock, and refuses a last-writer-wins write past it, so one wrong clock cannot carry every later one. Written fresh in
crate::sync. §M16.7 Y5. - IEEE 754-2008 decimal128 (binary integer decimal) — the
$numberDecimaltext both ways. Howard Hinnant’sdays_from_civil/civil_from_days— dates to and from ISO 8601 text.modules/mongo-compat/src/bson.rs. §M16 Q5.
Wire protocol, drivers and compatibility
- Neon’s serverless driver and libSQL’s Hrana (their documentation); RFC 6455 (WebSocket); FIPS 180-4 (SHA-1) — a database’s own protocol carried unchanged in a WebSocket’s binary messages, so browsers and edge runtimes reach the server with the same login and sessions. Written fresh in
nucleus-http-serve(websocket),nucleus-weband the JavaScript driver’sopenWebSocket; SHA-1 for the handshake innucleus_crypto::sha1. §M16.6b W1. - Neon’s serverless driver (queries over HTTP
fetch, its documentation); libSQL’s Hrana over HTTP; RFC 7617 (Basic), RFC 6750 (Bearer), the Fetch standard’s CORS protocol — a database’s own messages a request at a time over HTTP, each in a session of its own named byAuthorization; the preflight answered for any origin without credentials, and a media type of its own so a cross-site form cannot post. Written fresh innucleus-web(POST /ncp),nucleus_server::Exchange::logged_inand the JavaScript driver’sopenHttp. §M16.6b W2. - The GraphQL specification (October 2021) and GraphQL over HTTP; pg_graphql and PostGraphile (their documentation); Hasura’s documentation — a schema read from the catalog, each request compiled to one SQL statement building its JSON (relations as correlated subqueries, no N+1); Hasura’s names (
<table>_by_pk,<table>_bool_exp,_eq…_ilike,order_by) and mutation forms (insert_<table>withon_conflict,update_<table>with_setand_inc,delete_<table>,affected_rowsandreturning), each a data-modifyingWITH(PostgreSQL’s documentation). Written fresh innucleus-graphql(its parser, schema, compiler and introspection). §M16.6b G1–G2. - graphql-ws’s protocol document (
graphql-transport-ws, PROTOCOL.md) — the messages (connection_init,connection_ack,ping,pong,subscribe,next,error,complete) and the close codes (4400,4401,4403,4408,4409,4429); the login inconnection_init’s payload as Hasura’s and Apollo’s documentation send it. Written fresh innucleus-graphql(ws). §M16.6b G3. - PostgREST’s documentation (its API reference, error codes and HTTP statuses) — the query-string forms (
selectwith embeddings,col=op.value,or=(…),order=…nullslast,Range,Prefer: return=…, resolution=…,on_conflict,application/vnd.pgrst.object+json), the error body and the statuses by SQLSTATE. Written fresh innucleus-rest, compiled throughnucleus-graphql. §M16.6b R1. - The WHATWG HTML standard’s server-sent events — the event stream format (
event:,id:,data:, comments as keep-alives). Written fresh innucleus-rest(changes). §M16.6b R2. - RFC 9113 (HTTP/2) and RFC 7541 (HPACK) — a server’s framing, flow control and streams, and header compression; HPACK’s static table and Huffman code are taken from RFC 7541 as data (its Appendices A and B). Written fresh, synchronous, in
nucleus-http-serve(h2,hpack). §M16.6b P1. - gRPC’s “gRPC over HTTP2” protocol document and Protocol Buffers’ encoding documentation — a call’s messages framed with a length,
grpc-statusandgrpc-messagein the trailers,grpc-timeout, trailers-only answers; varints and wire types. Written fresh innucleus-grpc(protobuf read and written by hand);tonicandprostonly as the tests’ client. §M16.6b P1. - gRPC’s server reflection protocol (
grpc/reflection/v1/reflection.proto), protobuf’sdescriptor.proto, PostgreSQL’sattnumand Google’s API Improvement Proposals (AIP-134’s update mask) — the reflection stream’s requests and answers;FileDescriptorProto’s fields (checked byte for byte againstprotoc’s output); a column’s number given once and never again;Update‘s list of fields set. Written fresh innucleus-grpc(describe,reflection,tables) andnucleus-sql(Column::number);prost-typesonly as the tests’ decoder. §M16.6b P2. - The Model Context Protocol’s Streamable HTTP transport (its specification, 2025-03-26 and 2025-06-18) — MCP’s JSON-RPC posted to one endpoint and answered as JSON, notifications
202,MCP-Protocol-Versionchecked, theOriginchecked against DNS rebinding; no session and no stream of the server’s own. Written fresh innucleus_mcp::http; checked with the official TypeScript SDK’s client. §M16.6b, D19. - PgBouncer’s
server_reset_queryand PostgreSQL’sDISCARD ALL(their documentation) — a session handed to the next client only as a login leaves it; nucleus logs the next request in on it again with every check. Written fresh inSession::reuseandnucleus_server::session_for_reusing. gh #28. - Neon’s proxy and Supavisor (their documentation) — a password’s check over a protocol that logs in often, cached rather than derived again. Written fresh in
nucleus_crypto::ScramVerifier::matches(the verifier’s keys and an HMAC of the password, never the password). §M16.6b G1. - PostgreSQL’s protocol v3 and catalogs — an optional compatibility module only. §M12; D13/D14.
- libpq 14’s pipeline mode; Redis’s reply gathering — pipelining. §M14.20 W8.
- Oracle prefetch / JDBC fetch size — rows read ahead while the client fetches. §M14.20 W8.
- PGlite — the embedded engine behind its own protocol. §M14.23.
- rustls / quinn-proto’s sans-IO design —
Exchangefor WASM. §M14.23. - SQLite’s
opfs-sahpool; wa-sqlite’s access-handle pool — the OPFS slot pool. §M14.23. - Realm, Couchbase Lite, DuckDB Swift — a core with a C API under the mobile SDKs. §M14.23.
- Standards — RFC 5802 / 7677 SCRAM, RFC 5929, RFC 4616, RFC 7628, RFC 9562 UUIDs.
Statistics and numerics (§M14.27)
- Neal’s superaccumulator (2015) — the exact accumulator; Shewchuk’s expansions as its test oracle. S1, S14.
- PostgreSQL
numeric_stddev_internal,float8_regr_accum,nodeWindowAgg.c,orderedsetaggs.c— numeric results, semantics and errors. S2–S5. - DuckDB — skewness and kurtosis,
median,SUMMARIZE. S2, S5, S8b. - Leis, Kundhikanti, Kemper & Neumann, window functions (VLDB 2015); DuckDB
WindowSegmentTree— segment trees. S4. - Knuth’s Algorithm D (as Hacker’s Delight’s
divmnu) — exact division. S3. - Alabi et al. (2012) — selection for spilled quantiles. S5.
- HyperLogLog++ (Heule, Nunkesser & Hall, EDBT 2013) with Ertl’s estimator (2017); DDSketch (Masson, Rim & Lee, VLDB 2019); Space-Saving (Metwally, Agrawal & El Abbadi, 2005) and mergeable Misra–Gries (Agarwal et al., PODS 2012) — sketches. S6.
- PostgreSQL’s
TABLESAMPLE; Li’s Algorithm L (1994); Tirthapura & Woodruff (DISC 2011); Lemire’s bounded draw; repeatable hash splits — sampling. S7. - SciPy, Numerical Recipes and scikit-learn’s statistical tests; Siddiqi’s PSI — drift measures. S8a.
Embeddings and ML kernels (§M14.22)
- GotoBLAS / BLIS (Goto & van de Geijn, 2008) — the matrix product. E3b.
- Eigen’s / XLA’s rational
erf; Cephes’expf— E3b (their coefficients:THIRD_PARTY.md). - Hugging Face
tokenizers; SentencePiece — tokenizers. E3a. - text-embeddings-inference — token-budget batches without padding. E3b.
- Weinberger et al., feature hashing — the
hashingmodel. E2b. - LangChain’s
CacheBackedEmbeddings— the embedding cache. E2b.
Security and encryption
- RFC 8439 ChaCha20-Poly1305, poly1305-donna’s limbs; Bernstein’s and Goll–Gueron’s vectorized ChaCha20 — §M14.22 E2a; §M14.30 K2a.
- AES-GCM-SIV (RFC 8452), RFC 5297 SIV, Rogaway–Shrimpton DAE, RFC 3394 key wrap; Gueron & Lindell; OpenSSL / BoringSSL POLYVAL; HKDF (RFC 5869) — page and WAL sealing. §M14.30.
- STREAM; Tink streaming AEAD; RocksDB
EncryptedEnv’s place — sealed LSM files. §M14.28 L4e. - Crypto-shredding (Verraes; Akka; Axon) — per-subject keys destroyed by
FORGET. §M14.24 R6. - Apple Advanced Data Protection; Signal’s PIN-derived keys; pgsodium / Supabase Vault — keys held by users and outside the data. §M14.30; §M14.22.
- OWASP’s PBKDF2 rounds — §M14.30 K1a.
AI memory (§M14.24)
- Snowflake / BigQuery column tags — subject columns. R2.
- MongoDB’s TTL cadence; SQLite
secure_delete; Hyperscan / ripgrep’s rarest byte — expiry and erasure. R1–R2c. - pgAudit — extended to what was returned. R5.
- LongMemEval (Wu et al., ICLR 2025) — the benchmark. R1.
Operations and tooling
- Prometheus / OpenMetrics, OpenTelemetry (OTLP), W3C
traceparent; ClickHouseProfileEvents; CockroachDB health endpoints — metrics and tracing. §M14.18 O1–O2. - postgres_exporter / mysqld_exporter mixins — alert rules. O2.
- pgBackRest; restic / Borg; WAL-G / Barman; AWS SigV4 — backups. O3–O4.
- CockroachDB online schema changes and F1 (Rae et al., VLDB 2013); gh-ost / pt-osc; PostgreSQL
CREATE INDEX CONCURRENTLY,SET ACCESS METHOD; MySQLENGINE=— online type and engine changes. O5; §M14.28 L3b. - PostgreSQL
CREATE INDEX CONCURRENTLY(as its documentation describes it); F1’s write-only state (Rae et al., VLDB 2013) — an index kept by writers before it is read, filled in parts, then made ready. Issue #18 (online_index). - PostgreSQL’s binary-coercible type changes and
NOT VALID/VALIDATE CONSTRAINT(as its documentation describes them); F1’s states writers obey before the data is known to (Rae et al., VLDB 2013) — a column type that keeps the values changed in the catalog alone, a narrower one checked online after writers obey it, andNOT NULLand checks the same way. Issue #18 steps 2 and 3 (validating). - PostgreSQL 11’s fast
ADD COLUMN(a non-volatile default kept as the attribute’s missing value, as its documentation and release notes describe it) — a column added without rewriting the rows, which read the kept value. Issue #18 step 4 (Table::missing). - PostgreSQL’s
DROP COLUMN(a dropped attribute left in the stored tuples,attisdropped, as its documentation describes it) — a column dropped without rewriting the rows, which keep its place for readers to pass over. Issue #18 step 2b (Table::gone). pg_dump’s dependency sort; Flyway checksums; dbmate; golang-migrate / sqlx names; Railsschema_migrations; sqlc — migrations and code generation. §M14.16.- rustup’s, Deno’s and DuckDB’s install scripts; shell.duckdb.org, the PGlite REPL, SQLite fiddle — install and playground. §M14.17.
Projects
PostgreSQL https://www.postgresql.org · DuckDB https://duckdb.org · ClickHouse https://clickhouse.com · SQLite https://sqlite.org · RocksDB https://rocksdb.org · LevelDB https://github.com/google/leveldb · LMDB http://www.lmdb.tech · CockroachDB https://www.cockroachlabs.com · FoundationDB https://www.foundationdb.org · TigerBeetle https://tigerbeetle.com · Velox https://velox-lib.io · Apache DataFusion https://datafusion.apache.org · Apache Calcite https://calcite.apache.org · Apache Spark https://spark.apache.org · Apache Arrow https://arrow.apache.org · Apache Parquet https://parquet.apache.org · Apache Lucene https://lucene.apache.org · Tantivy https://github.com/quickwit-oss/tantivy · ParadeDB https://www.paradedb.com · Snowball https://snowballstem.org · Unicode https://www.unicode.org · pgvector https://github.com/pgvector/pgvector · hnswlib https://github.com/nmslib/hnswlib · FAISS https://github.com/facebookresearch/faiss · Qdrant https://qdrant.tech · Weaviate https://weaviate.io · Milvus https://milvus.io · Elasticsearch https://www.elastic.co/elasticsearch · Soufflé https://souffle-lang.github.io · Jepsen / Elle https://jepsen.io · SQLancer https://github.com/sqlancer/sqlancer · xxHash https://github.com/Cyan4973/xxHash · LZ4 https://lz4.org · PGlite https://pglite.dev · pgBackRest https://pgbackrest.org · restic https://restic.net · Prometheus https://prometheus.io · OpenTelemetry https://opentelemetry.io · sqlc https://sqlc.dev · gh-ost https://github.com/github/gh-ost · Hugging Face tokenizers https://github.com/huggingface/tokenizers · SentencePiece https://github.com/google/sentencepiece · BLIS https://github.com/flame/blis · Eigen https://eigen.tuxfamily.org · Cephes https://www.netlib.org/cephes/ · SciPy https://scipy.org · DDSketch https://github.com/DataDog/sketches-java