Other

kestrel

SQL database engine in Kotlin

A relational database engine written from scratch in Kotlin. It takes SQL queries from the command line, keeps data on disk and protects writes from being lost on a sudden power-off.

kestrel

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.

What we did

  1. 01

    Its own SQL parser

  2. 02

    An executor that runs the queries

  3. 03

    Data storage based on a B-tree

  4. 04

    Transactions with a WAL that protects writes in a crash

  5. 05

    A CLI for working with the database and a full test suite

Describe your project.

A free quote comes back within an hour during working hours.

Tell us what you want to build.

A free quote comes back within an hour during working hours. You talk to the person who writes the code.