George Berdovskiy

Software Engineer

CowabungaDB

GitHub

Description

CowabungaDB is a hybrid relational database management system built from scratch in Rust and Python as a project for the databases course at UC Davis. Developed collaboratively with a team of five students, our project was awarded best presentation and best performance for all three development milestones. The database is designed for high performance and concurrency, featuring a complete implementation of transactions, indexing, and persistent storage, all accessible through a Python interface.

Architecture

Our system utilizes an innovative architecture designed to support fast writes without sacrificing read speed.

Features

Concurrency

CowabungaDB ensures data integrity through fully-featured transactions. A central transaction manager acquires all necessary locks before execution. If any lock is unavailable, the transaction is immediately aborted and retried, preventing deadlocks.

Indexing

Every column in a table is indexed using a B-Tree that maps column values to a set of record IDs (RIDs). This allows for highly efficient queries, lookups, and range scans.

Buffer Pool

An in-memory buffer pool caches pages to accelerate data access. When the pool is full, a custom eviction policy identifies and replaces unpinned pages using a random selection strategy, avoiding complex accounting overhead.

Persistance

The entire database state, including tables, indexes, and buffer pool metadata, can be saved to disk, allowing the database to be closed and reopened without data loss.

Full Query Support

The database supports a complete set of CRUD operations as well as aggregate queries. Deletes are handled logically, marking RIDs as "dead" to be cleaned up later.

Speed

The decision to build CowabungaDB in Rust was central to our success. Its strong static type system allowed us to build a complex multi-threaded database with no memory bugs and blazing fast speeds.