A tiny, crash-safe SQL database written in C++20, built to learn how databases work. Its buffer pool predicts upcoming page reads and prefetches them, and benchmarks show whether that beats a plain LRU cache.
See docs/ideas/predictive-sql-db.md for the plan, scope and what's intentionally out of scope, docs/plan.md for milestones and learning material, and docs/HANDOFF.md for the current status.
Fresh start. The earlier key/value implementation is preserved on the archive/kv-v1 branch.
Requires Clang, CMake (3.25 or newer) and Ninja. To configure, build and run all tests:
cmake --workflow --preset debugBuilds go to build/debug/. To rebuild and rerun tests after that, use cmake --build --preset debug && ctest --preset debug.
- Pager: fixed 4 KB pages in one file
- Buffer pool: LRU eviction, configurable size, access-trace log
- B-tree table storage
- WAL + recovery (verified by a kill -9 harness)
- SQL subset:
CREATE TABLE,INSERT,SELECT ... WHERE pk = / BETWEENvia a REPL - Offline prefetch simulator (LRU vs. ARC vs. Markov)
- Benchmarks vs. SQLite
See LICENSE.