A distributed, transactional key-value database written in Rust, inspired by FoundationDB.
๐ Educational Project | ๐ Documentation
FerrisDB is an educational project where humans and AI collaborate to:
- Learn distributed systems by building one
- Implement a real database from scratch in Rust
- Pioneer human-AI collaborative development
โ ๏ธ NOT FOR PRODUCTION USEThis is a learning project. Components are built for education, not production reliability. We prioritize clarity and teaching value over performance and robustness.
We're building a distributed database inspired by FoundationDB's architecture. Like any ambitious project, we're starting with the foundation (storage engine) and building up to the full distributed system.
The storage engine foundation:
- Write-Ahead Log (WAL) - Durability with file headers, CRC32 checksums, and metrics
- MemTable - Lock-free concurrent skip list with MVCC timestamp support
- SSTable - Reader and writer with efficient binary search and block structure
- BytesMutExt - Zero-copy optimizations with 23-33% performance improvement
Active development on:
- Compaction - Background merging of SSTables
- Transaction Layer - ACID transaction support
- Distribution Layer - Data partitioning and replication
- Consensus Protocol - Likely Raft for coordination
A fully functional distributed database with:
- ACID Transactions - True serializable isolation
- Horizontal Scalability - Add nodes to scale out
- Fault Tolerance - Automatic failover and recovery
- Strong Consistency - Linearizable operations
- Simple API - Clean key-value interface
# Clone and build
git clone https://github.com/ferrisdb/ferrisdb.git
cd ferrisdb
cargo build --all
# Run tests
cargo test --all
# Explore the code
cargo doc --all --open
FerrisDB follows a layered architecture inspired by FoundationDB:
โโโโโโโโโโโโโโโโโโโ
โ Client Library โ [PLANNED]
โโโโโโโโโโฌโโโโโโโโโ
โ
โโโโโโโโโโผโโโโโโโโโ
โ Server (gRPC) โ [PLANNED]
โโโโโโโโโโฌโโโโโโโโโ
โ
โโโโโโโโโโผโโโโโโโโโ
โ Storage Engine โ [IN PROGRESS]
โ (LSM-tree) โ
โโโโโโโโโโฌโโโโโโโโโ
โ
โโโโโโโโโโโโผโโโโโโโโโโโ
โ โ โ
โโโโโโผโโโโโ โโโโโผโโโโโ โโโโโผโโโโโ
โMemTable โ โSSTablesโ โ WAL โ
โโโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโ
[COMPLETE] [COMPLETE] [COMPLETE]
Currently integrating the storage components into a working engine.
FerrisDB is unique: it's being built through genuine collaboration between human developers and AI. This isn't about AI generating code - it's about two different types of intelligence working together, each bringing their strengths:
- Human: Architecture vision, design decisions, "this feels wrong" intuition
- AI: Implementation details, edge case handling, systematic analysis
Read our development blog to see this collaboration in action!
- Website - Full documentation, tutorials, and blog
- Current Status - What's actually built today
- Architecture Overview - Current system design
- Future Architecture - Where we're heading
- Development Blog - Human and AI perspectives on building FerrisDB
- Tutorials - Learn by building database components
- Database Concepts - Deep dives into database internals
We offer hands-on tutorials where you build database components from scratch:
- Tutorial 01: Key-Value Store - Build a simple in-memory store with HashMap (โ Published)
- More tutorials coming soon! Check our tutorials page
We welcome contributions from both humans and AI!
- ๐ Read our Contributing Guide
- ๐๏ธ Check the Development Setup
- ๐ ๏ธ Run
./scripts/setup-dev-tools.sh
to install formatting tools - ๐ค AI contributors: See CLAUDE.md
- ๐ท๏ธ Browse open issues
- ๐ฌ Join discussions in pull requests
- Write-Ahead Log (with proper format)
- MemTable with SkipList
- SSTable writer & reader
- MVCC timestamps
- Storage engine integration (in progress)
- Compaction (next up)
- Bloom filters
- MVCC implementation
- Transaction coordinator
- Snapshot isolation
- Serializable transactions
- Data partitioning
- Replication protocol
- Failure detection
- Automatic recovery
- Raft consensus
- Cluster controller
- Configuration management
- Client routing
FerrisDB is not trying to be the next production database. It's:
- ๐ A Learning Platform - Watch a database being built from scratch
- ๐ค A Collaboration Experiment - Pioneering human-AI development
- ๐ฆ A Rust Teaching Tool - Learn Rust through real systems programming
- ๐ Open Documentation - Every decision explained, every mistake shared
If you need a production database, use PostgreSQL, SQLite, or FoundationDB.
If you want to learn how databases work, you're in the right place!
- Lines of Code: ~11,306 (implementation + tests)
- Tests: 217 passing tests
- Blog Posts: 10 (5 human, 5 Claude)
- Tutorials: 1 published, 9 planned
- Contributors: 1 human, 1 AI (Claude) - Join us!
- โ Enhanced WAL with file headers and metrics (Day 5)
- โ Achieved 23-33% performance improvement with zero-copy reads
- โ Published Tutorial 01: Building a Key-Value Store
- โ Established governance and contribution guidelines
- โ 10 blog posts documenting 5 days of development
- โ Comprehensive test suite with 217 tests
Apache License 2.0 - see LICENSE for details.
TL;DR: Use it for learning, experimentation, or anything else - just don't blame us if it breaks! ๐
Standing on the shoulders of giants:
- FoundationDB - Architectural inspiration
- RocksDB - LSM-tree wisdom
- The Rust community - Incredible ecosystem and support
Special thanks to all contributors - both human and AI - who are making this experiment possible! ๐ฆ๐ค
Join us in building the future of collaborative software development!