Certainly! Here's the updated documentation with the resource included:
A lightweight SQLite clone written in C, designed to explore how databases work from the ground up. This project walks through building a simple relational database step by step, covering key concepts like indexing, transactions, and storage formats.
Ever wondered how databases actually work under the hood?
- How is data stored in memory and on disk?
- What makes transactions and rollbacks possible?
- How do indexes speed up queries?
- What happens when a table gets too big?
This project is a hands-on attempt to build a database from scratch to understand these concepts deeply.
- 🖥️ Interactive REPL to run SQL-like commands
- 📝 Basic SQL compiler & virtual machine
- 📂 File-based storage for persistence
- 🌳 B-Tree indexing for fast lookups
- 🔄 Transaction support with rollbacks
- 🔍 Binary search for efficient queries
- The fundamentals of database storage (memory & disk)
- How SQL queries are processed behind the scenes
- How B-Trees work and why they’re used in databases
- The mechanics of transactions and rollbacks
- The basics of writing a mini SQL engine in C
- Setting up a simple REPL
- Building a SQL compiler & virtual machine
Implementing an in-memory databaseAdding file storage for persistenceCreating a cursor abstraction for data traversalImplementing B-Trees for indexingHandling binary search & duplicate keysSplitting leaf & internal nodesSupporting multi-level B-Tree traversalOptimizing query execution
- C Compiler: Ensure you have GCC or another C compiler installed.
- Make: Used to build the project.
Clone the repo and compile it using a C compiler:
git clone https://github.com/proXDhiya/simple-database-c.git
cd simple-database-c
make
./sqlite
Now you’re ready to start experimenting with database internals! 🚀
This project is inspired by SQLite’s architecture and is meant for learning and fun. It follows the tutorial available at cstack's DB tutorial. Feel free to contribute or tweak it to explore database internals further!