Skip to main content

RookDB

Introduction

  • RookDB is an open-source database storage engine written in Rust and designed to explore the internal architecture of Relational database management systems.
  • The project focuses on building a Disk-oriented database management system (DBMS) that stores and manages data efficiently on persistent storage while supporting query processing.
  • The current development of RookDB primarily focuses on the Storage Engine - RookDB, which handles data organization, storage structures, Catalog Manager, Buffer Manager, Table layout, Page Layout and Tuple Layout. For a high-level understanding of the system workflow and components, refer to the architecture figure below.

Relation Model DBMS Architecture


Project Architecture

The RookDB project is currently organized into three main repositories:

  1. rookdb-cli
  2. rook-parser
  3. RookDB (Storage Engine)

rookdb-cli

The command-line interface used to interact with the database.
It accepts SQL queries from the user, forwards them to the parser, and displays the output to the user.

rook-parser

The SQL parser is responsible for performing lexical and syntactic analysis of SQL queries. It converts SQL queries into an Abstract Syntax Tree (AST), which is then translated into the required input parameters for the Storage Engine and passed to it for execution.

RookDB

The RookDB Storage Engine is the core component of the system responsible for executing parsed instructions and performing database operations. It processes the structured input generated by the SQL parser and carries out CRUD operations (Create, Read, Update, Delete) on the underlying data stored on disk.

Query Flow

  1. User enters an SQL query in rookdb-cli
  2. The query is sent to rook-parser
  3. The parser performs lexical and syntactic analysis
  4. Parsed instructions are sent to RookDB
  5. The storage engine executes the operation
  6. Results are returned to the CLI