mhtirogla
Home
Systems
API
Pricing
About
Log in
← Back
Home
›
Systems
›
Databases and storage engines
embedded-sql
embedded single-file SQL database
SQLite, DuckDB
System
Techniques · 11
Primitives · 33
embedded-sql
External merge sort
search-sort · medium: Sort data larger than RAM: write memory-sized sorted runs, then k-way merge them with large sequential buffers; terabytes in one merge pass.
›
Buffer pool
storage · medium: The database's own page cache (frames, page table, pin counts, dirty bits, replacement) so it, not the OS, controls eviction, write order and I/O.
›
Columnar storage
storage · medium: Store each column contiguously so analytic scans read only the columns they need, compress well and run as tight SIMD loops.
›
Morsel driven parallelism
storage · medium: Split pipelines into small morsels scheduled NUMA-aware across worker threads
MVCC
storage · medium: Keep timestamped versions of each row so readers see a consistent snapshot without blocking writers; the default concurrency control in modern databases.
›
Query optimizer
storage · medium: Cost-based plan search: join ordering (DP/greedy), rewrites, access path selection
Vectorized execution
storage · medium: Query operators pass batches of about 1-2K values per column instead of single tuples, amortizing interpretation overhead and enabling tight SIMD loops.
›
fsync, O_DSYNC and O_DIRECT
hardware-os · low: What fsync, fdatasync, O_DSYNC, O_DIRECT and F_FULLFSYNC really guarantee on Linux and macOS, and the exact call sequences for crash-safe files.
›
Zone maps
storage · low: Per-block min/max (and sparse primary) indexes to skip data during scans
Hash join
storage · low: Build a hash table on the smaller input's join key and probe it with every row of the larger one; the linear-time workhorse for equi-joins.
›
Bytecode interpreter
compilers · low: Register/stack VM dispatch loop for executing compiled plans or rules (SQLite VDBE, nftables)
Recursive-descent parsing
compilers · low: Hand-written top-down parser with one function per grammar rule; simple, fast, with full control over error messages and recovery.
›
Varint (LEB128)
compression · low: Variable-length integers in 7-bit groups with a continuation bit; small numbers take 1 byte, the wire format of Protobuf, WebAssembly and DWARF.
›
Advisory file locking
hardware-os · low: Fcntl/flock byte-range and whole-file locks for multi-process access to one file
mmap and the page cache
hardware-os · low: How read() and mmap reach file data through the kernel page cache, what readahead and madvise do, and why databases use their own buffer pool instead.
›
B+ tree
storage · low: Balanced high-fanout search tree with all values in linked leaves; the default on-disk index for point lookups and range scans.
›
Hash aggregation
storage · low: GROUP BY via hash tables with partitioning and spill to disk
Slotted pages
storage · low: Fixed-size page layout for variable-length records, with a slot array growing from the front and data from the back; stable record IDs despite compaction.
›
Write-ahead log
storage · low: Append each change to a checksummed sequential log and fsync it before touching data pages; the basis of crash durability in nearly every database.
›
Buffer pools for zero-allocation I/O
hardware-os · low: Preallocate a fixed set of aligned I/O buffers and recycle them through a free list, so the hot path never mallocs, faults or unmaps. The bounded count doubles as back pressure.
›
K way merge
search-sort · low: Merge k sorted streams with a heap or loser tree (merging iterators)
Pattern-defeating quicksort (pdqsor…
search-sort · low: Introsort successor: quicksort with adaptive pivots, linear on sorted and equal-heavy input, heapsort fallback; the unstable sort of Go and (until 1.81) Rust.
›
LRU and CLOCK
systems · low: LRU evicts the least recently used entry via hash map plus linked list; CLOCK approximates it with a reference bit, so hits take no lock.
›
+ 4 more techniques
+ 17 more primitives
System
Techniques · 11
Primitives · 33
embedded-sql
External merge sort
search-sort · medium: Sort data larger than RAM: write memory-sized sorted runs, then k-way merge them with large sequential buffers; terabytes in one merge pass.
›
Buffer pool
storage · medium: The database's own page cache (frames, page table, pin counts, dirty bits, replacement) so it, not the OS, controls eviction, write order and I/O.
›
Columnar storage
storage · medium: Store each column contiguously so analytic scans read only the columns they need, compress well and run as tight SIMD loops.
›
Morsel driven parallelism
storage · medium: Split pipelines into small morsels scheduled NUMA-aware across worker threads
MVCC
storage · medium: Keep timestamped versions of each row so readers see a consistent snapshot without blocking writers; the default concurrency control in modern databases.
›
Query optimizer
storage · medium: Cost-based plan search: join ordering (DP/greedy), rewrites, access path selection
Vectorized execution
storage · medium: Query operators pass batches of about 1-2K values per column instead of single tuples, amortizing interpretation overhead and enabling tight SIMD loops.
›
Work-stealing deque
concurrency · medium: Per-worker deque: the owner pushes and pops at the bottom without contention, idle workers steal from the top; the core of Rayon, Tokio and Go.
›
Cardinality estimation
storage · medium: Row-count estimates from histograms, MCVs, sketches and sampling for the optimizer
Join order dynamic programming
storage · medium: DPccp and DPhyp enumeration of join orders with cost models; greedy fallback for many joins
Subquery decorrelation
storage · medium: Unnest correlated subqueries into joins via dependent join and magic sets
fsync, O_DSYNC and O_DIRECT
hardware-os · low: What fsync, fdatasync, O_DSYNC, O_DIRECT and F_FULLFSYNC really guarantee on Linux and macOS, and the exact call sequences for crash-safe files.
›
Zone maps
storage · low: Per-block min/max (and sparse primary) indexes to skip data during scans
Hash join
storage · low: Build a hash table on the smaller input's join key and probe it with every row of the larger one; the linear-time workhorse for equi-joins.
›
Bytecode interpreter
compilers · low: Register/stack VM dispatch loop for executing compiled plans or rules (SQLite VDBE, nftables)
Recursive-descent parsing
compilers · low: Hand-written top-down parser with one function per grammar rule; simple, fast, with full control over error messages and recovery.
›
Varint (LEB128)
compression · low: Variable-length integers in 7-bit groups with a continuation bit; small numbers take 1 byte, the wire format of Protobuf, WebAssembly and DWARF.
›
Advisory file locking
hardware-os · low: Fcntl/flock byte-range and whole-file locks for multi-process access to one file
mmap and the page cache
hardware-os · low: How read() and mmap reach file data through the kernel page cache, what readahead and madvise do, and why databases use their own buffer pool instead.
›
B+ tree
storage · low: Balanced high-fanout search tree with all values in linked leaves; the default on-disk index for point lookups and range scans.
›
Hash aggregation
storage · low: GROUP BY via hash tables with partitioning and spill to disk
Slotted pages
storage · low: Fixed-size page layout for variable-length records, with a slot array growing from the front and data from the back; stable record IDs despite compaction.
›
Write-ahead log
storage · low: Append each change to a checksummed sequential log and fsync it before touching data pages; the basis of crash durability in nearly every database.
›
Buffer pools for zero-allocation I/O
hardware-os · low: Preallocate a fixed set of aligned I/O buffers and recycle them through a free list, so the hot path never mallocs, faults or unmaps. The bounded count doubles as back pressure.
›
K way merge
search-sort · low: Merge k sorted streams with a heap or loser tree (merging iterators)
Pattern-defeating quicksort (pdqsor…
search-sort · low: Introsort successor: quicksort with adaptive pivots, linear on sorted and equal-heavy input, heapsort fallback; the unstable sort of Go and (until 1.81) Rust.
›
LRU and CLOCK
systems · low: LRU evicts the least recently used entry via hash map plus linked list; CLOCK approximates it with a reference bit, so hits take no lock.
›
S3-FIFO
systems · low: Three FIFO queues (small, main, ghost) that evict one-hit wonders quickly and keep reused objects; low miss ratios with no list moves on hits.
›
Bit packing and PFOR
compression · low: Store blocks of integers with exactly b bits each and patch rare outliers separately (PFOR); the fastest integer codec family, billions of values per second.
›
Delta encoding
compression · low: Store differences between consecutive values instead of the values, turning sorted IDs, timestamps and counters into small numbers that pack into few bits.
›
Dictionary encoding
compression · low: Map values to small integer codes via a dictionary for compact, comparable columns
Numa aware allocation
hardware-os · low: Allocate memory and pin threads on the local NUMA node; first-touch and interleave policies
Partition pruning
storage · low: Skip whole partitions using partition transforms and predicate analysis
Predicate pushdown
storage · low: Move filters and projections into scans and remote sources
Relational algebra
storage · low: Relational operators and equivalence rules: selection pushdown, join reordering, projections
Epoch-based reclamation
concurrency · low: Threads announce a global epoch while touching shared lock-free data; garbage retired in epoch e is freed once the epoch reaches e + 2.
›
Memory ordering
concurrency · low: What Relaxed, Acquire, Release and SeqCst atomics actually guarantee, what they cost on x86 and ARM, and which one each pattern needs.
›
HyperLogLog
data-structures · low: Counts distinct elements in kilobytes with about 1 % error by tracking the longest run of leading zero bits in hashed values per bucket.
›
Quantile sketches
data-structures · low: Mergeable quantile sketches: t-digest, DDSketch, HDR histograms
Reservoir sampling
data-structures · low: Uniform k-sample from a stream of unknown length (Algorithm R/L)
Fast hash functions
data-structures · low: Non-cryptographic hashes built from 64×64→128-bit multiplies and xor-shifts; pick by key size, trust level and whether the hash is persisted.
›
CRC32C checksums
hardware-os · low: The Castagnoli CRC-32 with dedicated instructions on x86 (SSE4.2) and ARMv8. It is the standard fast integrity check for storage blocks, logs and network frames.
›
SIMD programming
hardware-os · low: Process 4-16 lanes per instruction with AVX2, AVX-512 or NEON via Rust std::arch, with runtime dispatch and a portable fallback.
›
Virtual memory and the TLB
hardware-os · low: How page tables and TLBs translate every address, what TLB reach means, and when 2 MiB or 1 GiB huge pages pay off on Linux.
›
Copy for AI
Similar systems
Share the most building blocks with this one.
relational-db
37 %
btree-engine
30 %
query-engine
29 %
graph-db
26 %
htap-db
24 %