Giter Club home page Giter Club logo

lightdb's Introduction

lightdb is a lightweight disk-oriented relational database written in C++ which implements some key components of a traditional RDBMS including: Buffer Pool Manager (for memory management), Hash Index (storage engine), Query Executors & Query Optimizer (operators & optimizer), and Concurrency Control.

I created lightdb as a side-project in 2021 while learning database system at university and am in the process of migrating the code and docs to GitHub.

It is based on Dr Andy Pavlo's (@pavlo) BusTub database system template which is as simple as follows. The files inside src and test are empty and open to implementation using the super-useful tools and relevant third_party libraries.

bustub
├── build_support
│   ├── ...
├── src
│   ├── binder
│   ├── buffer
│   ├── catalog
│   ├── common
│   ├── concurrency
│   ├── container
│   ├── execution
│   ├── include
│   ├── optimizer
│   ├── planner
│   ├── primer
│   ├── recovery
│   ├── storage
│   └── type
├── test
│   ├── ...
├── third_party
│   ├── argparse
│   ├── backward-cpp
│   ├── cpp_random_distributions
│   ├── fmt
│   ├── googletest
│   ├── libfort
│   ├── libpg_query
│   ├── linenoise
│   ├── murmur3
│   ├── readerwriterqueue
│   ├── utf8proc
│   └── versions.txt
└── tools
    ├── b_plus_tree_printer
    ├── backtrace.cpp
    ├── bpm_bench
    ├── btree_bench
    ├── htable_bench
    ├── nc-shell
    ├── shell
    ├── sqllogictest
    ├── terrier_bench
    ├── wasm-bpt-printer
    └── wasm-shell

Build

It is preferred to build lightdb on Ubuntu 22.04, or macOS (M1/M2/Intel).

Linux (Recommended) / macOS (Development Only)

To ensure that you have the proper packages on your machine, run the following script to automatically install them:

# Linux
$ sudo build_support/packages.sh
# macOS
$ build_support/packages.sh

Then run the following commands to build the system:

$ mkdir build
$ cd build
$ cmake ..
$ make

If you want to compile the system in debug mode, pass in the following flag to cmake: Debug mode:

$ cmake -DCMAKE_BUILD_TYPE=Debug ..
$ make -j`nproc`

This enables AddressSanitizer by default.

If you want to use other sanitizers,

$ cmake -DCMAKE_BUILD_TYPE=Debug -DBUSTUB_SANITIZER=thread ..
$ make -j`nproc`

There are some differences between macOS and Linux (i.e., mutex behavior) that might cause test cases to produce different results in different platforms. We recommend students to use a Linux VM for running test cases and reproducing errors whenever possible.

lightdb's People

Contributors

skyzh avatar wuwenw avatar rickyyx avatar lmwnshn avatar yliang412 avatar turingcompl33t avatar apavlo avatar garrisonhess avatar github-actions[bot] avatar muffpy avatar timlee0119 avatar xzhseh avatar averyqi115 avatar jkosh44 avatar utkarsh39 avatar christopherlim98 avatar xuser5000 avatar fernandolis10 avatar chaoszhai avatar darkforte avatar amstqq avatar kush789 avatar songzhaozhe avatar yuhongzhang98 avatar wenxuanqiu avatar ziyi-yan avatar el-even-11 avatar xinzhu-cai avatar tupaschoal avatar preetansh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.