About the project
kestrel is a relational database engine written from scratch in Kotlin: a SQL parser, B-tree storage, an executor, transactions and a CLI. The parser understands SQL queries and the executor runs them on data held in a B-tree, a structure that makes it quick to find a record on disk. Transactions rely on a WAL (a write-ahead log that protects data in a crash). The engine runs real SQL queries and is covered by a full test suite.
The challenge
Writing a database from scratch means facing what is usually hidden: how to keep data on disk, how to parse SQL and how not to lose a write on a sudden power-off. In kestrel each of these had to be solved by hand.