Giter Site home page Giter Site logo

yxwei-umn / dariadb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lysevi/dariadb

0.0 0.0 0.0 6.05 MB

dariadb - is a numeric time-series database storage engine.

License: Apache License 2.0

Shell 0.60% C++ 95.42% Go 1.02% PowerShell 0.02% CMake 2.94%

dariadb's Introduction

dariadb - numeric time-series database.

Continuous Integration

version build & tests test coverage
master Build Status codecov
develop Build Status codecov

Features

  • True columnar storage
  • Can be used as a server application or an embedded library.
  • Full featured http api.
  • Golang client (see folders "go" and "examples/go")
  • Accept unordered data.
  • Each measurement contains:
    • Id - x32 unsigned integer value.
    • Time - x64 timestamp.
    • Value - x64 float.
    • Flag - x32 unsigned integer.
  • Write strategies:
    • wal - little cache and all values storing to disk in write ahead log. optimised for big write load(but slower than 'memory' strategy).
    • compressed - all values compressed for good disk usage without writing to sorted layer.
    • memory - all values stored in memory and dropped to disk when memory limit is ended.
    • cache - all values stored in memory with writes to disk.
    • memory-only - all valeus stored only in memory.
  • LSM-like storage struct with three layers:
    • Memory cache or Append-only files layer, for fast write speed and crash-safety(if strategy is 'wal').
    • Old values stored in compressed block for better disk space usage.
  • High write speed:
    • as embedded engine - to disk - 1.5 - 3.5 millions values per second to disk
    • as memory storage(when strategy is 'memory') - 7-9 millions.
    • across the network - 700k - 800k values per second
  • Shard-engine: you can split values per shard in disk, for better compaction and read speed up.
  • Crash recovery.
  • CRC32 for all values.
  • Two variants of API:
    • Functor API (async) - engine apply given function to each measurement in the incoming request.
    • Standard API - You can Query interval as list or values in time point as dictionary.
  • Compaction old data with filtration support;
  • Statistic:
    • time min/max
    • value min/max
    • measurement count
    • values sum
  • Statistical functions:
    • minimum
    • maximum
    • count
    • average
    • median
    • sigma(standard deviation)
    • percentile90
    • percentile99
  • Interval aggregation support. Available intervals: raw,minute, half hour, hour, day, week, month, year.

Usage example

  • See folder "examples"
  • How to use dariadb as a embedded storage engine: dariadb-example

Dependencies

  • Boost 1.54.0 or higher: system, filesystem, date_time,regex, program_options, asio.
  • cmake 3.1 or higher
  • c++ 14/17 compiler (MSVC 2015, gcc 6.0, clang 3.8)

Build


Install dependencies

$ sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
$ sudo apt-get update
$ sudo apt-get install -y libboost-dev  libboost-filesystem-dev libboost-program-options-dev libasio-dev libboost-date-time-dev cmake  g++-6  gcc-6 cpp-6 
$ export CC="gcc-6"
$ export CXX="g++-6"

Jemalloc

Optionaly you can install jemalloc for better memory usage.

$ sudo apt-get install libjemalloc-dev

Or you may use builtin jemalloc source in dariadb - just add build option -DSYSTEM_JEMALLOC=OFF

Git submodules

$ cd dariadb
$ git submodules init 
$ git submodules update

Available build options

  • DARIADB_ENABLE_TESTS - Enable testing of the dariadb. - ON
  • DARIADB_ENABLE_INTEGRATION_TESTS - Enable integration test. - ON
  • DARIADB_ENABLE_SERVER - Enable build dariadb server. - ON
  • DARIADB_ENABLE_BENCHMARKS - Enable build dariadb benchmarks. - ON
  • DARIADB_ENABLE_SAMPLES - Build dariadb sample programs. - ON
  • DARIADB_ASAN_UBSAN - Enable address & undefined behavior sanitizer for binary. - OFF
  • DARIADB_MSAN - Enable memory sanitizer for binary. - OFF
  • DARIADB_SYSTEM_JEMALLOC - Use jemalloc installed in the system. - ON

Configure to build with all benchmarks, but without tests and server.


$ cmake  -DCMAKE_BUILD_TYPE=Release -DDARIADB_ENABLE_TESTS=OFF -DDARIADB_ENABLE_INTEGRATION_TESTS=OFF -DDARIADB_ENABLE_BENCHMARKS=ON -DDARIADB_ENABLE_SERVER=OFF . 

clang


Clang currently does not supported.

$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS_RELEASE="${CMAKE_CXX_FLAGS_RELEASE} -stdlib=libc++" -DCMAKE_EXE_LINKER_FLAGS="${CMAKE_EXE_LINKER_FLAGS} -lstdc++" .
$ make

gcc


$ cmake -DCMAKE_BUILD_TYPE=Release .
$ make

Microsoft Visual Studio


$ cmake -G "Visual Studio 14 2015 Win64" .
$ cmake --build .

if you want to build benchmarks and tests

$ cmake -G "Visual Studio 14 2015 Win64" -DBUILD_SHARED_LIBS=FALSE  .
$ cmake --build .

build with non system installed boost


$ cmake  -DCMAKE_BUILD_TYPE=Release -DBOOST_ROOT="path/to/boost/" .
$ make

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.