Skip to content

jiangzhe/doradb

Repository files navigation

DoraDB

build codecov

DoraDB is an attempt to build a modern and fast storage engine in Rust from scratch. It is work in progress.

Goal

The original goal is to build a complete relational database, compatible with MySQL.

After coding about 70k lines of Rust, I have to admit it's really too ambitious to achieve as a single-person project.

Current goal is to build a modern and fast storage engine, which is probably achievable. I also want it to be useful (not just a toy) after major features are done.

The storage engine is designed as a hybrid engine with both in-memory row store and on-disk column store, and have full transactional support across all data.

Design

Above documents describe the core design of this engine. Most parts are update-to-date. Some ideas are different from traditional database system. I'm glad to have discussions if someone is interested in details.

Code Structure

  • buffer: Buffer pool implementation with async direct IO.
  • catalog: Catalog of storage engine.
  • compression: Compression algorithms for column store.
  • file: Storage of table data, index and delete bitmap. The file is page based and organized as CoW B+Tree, to enable simple recovery and fast access.
  • index: Block index and B+Tree index.
  • io: Async direct IO system with compile-time-selected libaio and io_uring backends, by default io_uring.
  • latch: Async latch primitives including Mutex, RWLock and HybridLatch(enhanced RWLock with optimistic mode).
  • lwc: LightWeight Columnar format for on-disk warm data.
  • row: In-memory row store and operations.
  • stmt: Statements.
  • table: Table of data, composite of block index, secondary index, buffer pool and table file. Support operations like index lookup, index scan, table scan, insert, delete, update, etc.
  • trx: Transaction system, including transaction lifecycle, redo log, undo log, recovery, garbage collect, etc.

Document-Driven AI Development Flow

Current development is heavily driven by document starting from Jan 2026, and implemneted by code agent. Every task assigned to agent has one associated task document located in docs/tasks. Larger features/refactors require RFC document inside docs/rfcs. Deferred tasks are put in docs/backlogs.

License

This project is licensed under either of

at your option.

About

DoraDB - Yet Another Storage Engine written in Rust

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Contributors

Languages