Skip to content

tahmidsadik/simple-db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-db

A simple sql database written in rust. One day I was wondering about how cool databases are and how do they work internally. And what better way to learn about database internals than to build one for yourself. This is an attempt to create a very simple sql database to learn about how they work.

Screenshots

Alt text Alt text

Progress

The project is in very early stage. The features that have been implemented:

  • REPL Interface
  • Distinguish between meta commands and db commands.
  • Columnar storage engine.
  • Create Table Command
  • Generic validation structure.
  • persistance with a command .persist
  • Serialization | Deserialization to and from binary encodings.
  • simple insert queries.
  • In memory btree indexes only for primary keys.
  • simple select queries ( only single where clause and no joins ).
  • unique key constraints.

Roadmap

Features that are in the roadmap of the proejct:

  • Joins
    • Inner
    • Left
    • Outer
  • Indexing - cost and performance gain analysis
  • Benchmarking
  • Server Client / Connection Manager
  • Lock manager
  • Concurrency
  • Pluggable storage engine
  • Different implementations of storage engines to optimize different operations
    • Write Heavy - LSM Tree && SSTable
    • Read Heavy - B-Tree

Getting Started

The project is written in rust, so you need it in your system. You can get started with rust from here https://rustup.rs/. Then just clone the project and cargo run to run it.

  • .tables - prints list of tables with schema
  • .data - prints all rows of all tables. Useful for debugging
  • .exit - to exit

About

A simple sql database written in rust.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages