Giter Club home page Giter Club logo

lineairdb's Introduction

LineairDB

Version Documentation License: Apache--2.0

LineairDB is a fast transactional key-value storage library. It provides transaction processing for multiple keys with strict serializability.

Features


  • Keys and values are arbitrary byte arrays.
  • The basic operations are read(key), write(key, value), ExecuteTransaction(procedure, callback).
  • Changes in a transaction for multiple key-value pairs are made with atomicity and durability.
  • Concurrent transactions are processed with strict serializability.
  • In contended write-heavy workloads, high scalability for many-core CPUs is provided.

Notes


  • LineairDB is not an SQL (Relational) database.
  • There is no client-server support in the library (i.e., LineairDB is an embedded database).

Usage

#include <lineairdb/lineairdb.h>

int main() {
  {
    LineairDB::Database db;
    LineairDB::TxStatus status;

    // Execute: enqueue a transaction with an expected callback
    db.ExecuteTransaction(
        [](LineairDB::Transaction& tx) {
          auto alice = tx.Read<int>("alice");
          if (alice.has_value()) {
            int alice = alice.value();
          }
          tx.Write<int>("bob", 1);
        },
        [&](LineairDB::TxStatus s) { status = s; });

    // Fence: Block-wait until all running transactions are terminated
    db.Fence();
    // status == LineairDB::TxStatus::Committed;
  }
}

Getting the Source

git clone --recurse-submodules https://github.com/lineairdb/lineairdb.git

Building

Quick start:

mkdir -p build && cd build
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release .. && make && sudo make install

Then you can use LineairDB by including the header include/lineairdb/lineairdb.h.

Compatibility

We have been tested LineairDB in the following environments:

  • Apple clang version 11.0.3
  • Clang 6 and 9 on Linux

Documentation


You can get the LineairDB library documentation by simply running

doxygen

and open docs/build/html/index.html.

Technical detail of concurrency control protocols such as SiloNWR is also available in the research paper at this link. The project roadmap is here.

Benchmark Results

The followings are our benchmark results. This is a modified benchmark of YCSB-A; unlike official YCSB in which a transaction operates a single key, each transaction operates on four keys in our benchmark.

This benchmark is executed in the following environments:

CPU four Intel Xeon E7-8870 (total 144 logical cores)
Memory 1TB (no swap-out)
YCSB Table size 100K
YCSB Record size 8-bytes
Epoch size 1000ms
Contention (θ) 0.9 (highly contended)
# of threads to process txns 70

YCSB-A

SiloNWR, our novel concurrency control protocol, achieves excellent performance over 10 Million transaction per seconds (TPS) by omitting transactions without exclusive lockings. Note that YCSB-A has an operation ratio of Read 50% and (Blind) Write 50%; that is, this is a fairly favorable setting for NWR-protocols. If your use case is such a blind write-intensive, then LineairDB can be a great solution.

Contributing

This project welcomes contributions, issues, suggestions, and feature requests.
Feel free to check issues page.

Question & Discussion

If you have any questions, please feel free to ask on slack. Join to slack

lineairdb's People

Contributors

nikezono 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.