All Projects → eBay → Jungle

eBay / Jungle

Licence: apache-2.0
An embedded key-value store library specialized for building state machine and log store

Projects that are alternatives of or similar to Jungle

Xstateful
A wrapper for xstate that stores state, handles transitions, emits events for state changes and actions/activities, and includes an optional reducer framework for updating state and invoking side-effects
Stars: ✭ 81 (-26.36%)
Mutual labels:  state-machine
React Automata
A state machine abstraction for React
Stars: ✭ 1,316 (+1096.36%)
Mutual labels:  state-machine
Statemachine
Statemachine in PHP 5.6 / PHP 7
Stars: ✭ 99 (-10%)
Mutual labels:  state-machine
Tupl
The Unnamed Persistence Library
Stars: ✭ 83 (-24.55%)
Mutual labels:  key-value-store
Finity
A finite state machine library for Node.js and the browser with a friendly configuration DSL.
Stars: ✭ 88 (-20%)
Mutual labels:  state-machine
Workflow Swift
A Swift and Kotlin library for making composable state machines, and UIs driven by those state machines.
Stars: ✭ 92 (-16.36%)
Mutual labels:  state-machine
Weexplus
🔨基于阿里WeexSDK跨平台方案,在原有的组件基础上,提供weex调用android native方法的一套扩展通信交互库,包含页面导航、数据存储、图片选择、二维码识别、权限等。
Stars: ✭ 73 (-33.64%)
Mutual labels:  hybrid
Hsm
Finite state machine library based on the boost hana meta programming library. It follows the principles of the boost msm and boost sml libraries, but tries to reduce own complex meta programming code to a minimum.
Stars: ✭ 106 (-3.64%)
Mutual labels:  state-machine
Pufferdb
🐡 An Android & JVM key-value storage powered by Protobuf and Coroutines
Stars: ✭ 91 (-17.27%)
Mutual labels:  key-value-store
Finite
UI as finite-state machine
Stars: ✭ 99 (-10%)
Mutual labels:  state-machine
Statemachineone
State Machine library for PHP
Stars: ✭ 84 (-23.64%)
Mutual labels:  state-machine
Hybrid Crypto Js
RSA+AES hybrid encryption implementation for JavaScript. Works with Node.js, React Native and modern browsers.
Stars: ✭ 87 (-20.91%)
Mutual labels:  hybrid
Mobile Web Best Practice
🐯 移动 web 最佳实践
Stars: ✭ 1,333 (+1111.82%)
Mutual labels:  hybrid
Tulip Control
Temporal Logic Planning toolbox
Stars: ✭ 81 (-26.36%)
Mutual labels:  state-machine
Library
Collection of papers in the field of distributed systems, game theory, cryptography, cryptoeconomics, zero knowledge
Stars: ✭ 100 (-9.09%)
Mutual labels:  state-machine
Memento
Fairly basic redis-like hashmap implementation on top of a epoll TCP server.
Stars: ✭ 74 (-32.73%)
Mutual labels:  key-value-store
Makina
A simple hierarchical state machine compiler that generates C.
Stars: ✭ 93 (-15.45%)
Mutual labels:  state-machine
Qpn
QP-nano real-time embedded framework/RTOS for embedded systems based on active objects (actors) and hierarchical state machines
Stars: ✭ 107 (-2.73%)
Mutual labels:  state-machine
Xut.js
批量生成应用平台 http://t.cn/RazBbL0
Stars: ✭ 105 (-4.55%)
Mutual labels:  hybrid
Incubator Pegasus
['pɛgəsəs] A distributed key-value storage system developed and maintained by Xiaomi Cloud Storage Team.
Stars: ✭ 1,346 (+1123.64%)
Mutual labels:  key-value-store

Jungle

build codecov

Embedded key-value storage library, based on a combined index of LSM-tree and copy-on-write (append-only) B+tree. Please refer to our paper.

Jungle is specialized for building replicated state machine of consensus protocols such as Paxos or Raft, by providing chronological ordering and lightweight persistent snapshot. It can be also used for building log store.

Features

  • Ordered mapping of key and its value on disk (file system). Both key and value are arbitrary length binary.
  • Monotonically increasing sequence number for each key-value modification.
  • Point lookup on both key and sequence number.
  • Range lookup on both key and sequence number, by using iterator:
    • Snapshot isolation: each individual iterator is a snapshot.
    • Bi-directional traversal and jump: prev, next, gotoBegin, gotoEnd, and seek.
  • Lightweight persistent snapshot, based on sequence number:
    • Nearly no overhead for the creation of a snapshot.
    • Snapshots are durable; preserved even after process restart.
  • Tunable configurations:
    • The number of threads for log flushing and compaction.
    • Custom size ratio between LSM levels.
    • Compaction factor (please refer to the paper).
  • Log store mode:
    • Ordered mapping of sequence number and value, eliminating key indexing.
    • Lightweight log truncation based on sequence number.

Things we DO NOT (and also WILL NOT) support

  • Secondary indexing, or SQL-like query:
    • Jungle will not understand the contents of value. Value is just a binary from Jungle's point of view.
  • Server-client style service, or all other network-involving tasks such as replication:
    • Jungle is a library that should be embedded into your process.

Benefits

Compared to other widely used LSM-based key-value storage libraries, benefits of Jungle are as follows:

  • Smaller write amplification.
    • Jungle will have 4-5 times less write amplification, while providing the similar level of write performance.
  • Chronological ordering of key-value pairs
    • Along with persistent logical snapshot, this feature is very useful when you use it as a replicated state machine for Paxos or Raft.

How to Build

1. Install cmake:

  • Ubuntu
$ sudo apt-get install cmake
  • OSX
$ brew install cmake

2. Build

jungle$ ./prepare.sh -j8
jungle$ mkdir build
jungle$ cd build
jungle/build$ cmake ../
jungle/build$ make

Run unit tests:

jungle/build$ ./runtests.sh

How to Use

Please refer to this document.

Example Implementation

Please refer to examples.

Supported Platforms

  • Ubuntu (tested on 14.04, 16.04, and 18.04)
  • Centos (tested on 7)
  • OSX (tested on 10.13 and 10.14)

Platforms will be supported in the future

  • Windows

Contributing to This Project

We welcome contributions. If you find any bugs, potential flaws and edge cases, improvements, new feature suggestions or discussions, please submit issues or pull requests.

Contact

Coding Convention

  • Recommended not to exceed 90 characters per line.
  • Indent: 4 spaces, K&R (1TBS).
  • Class & struct name: UpperCamelCase.
  • Member function and member variable name: lowerCamelCase.
  • Local variable, helper function, and parameter name: snake_case.
class MyClass {
public:
    void myFunction(int my_parameter) {
        int local_var = my_parameter + 1;
        if (local_var < myVariable) {
            // ...
        } else {
            // ...
        }
    }
private:
    int myVariable;
};

int helper_function() {
    return 0;
}
  • Header include order: local to global.
    1. Header file corresponding to this source file (if applicable).
    2. Header files in the same project (i.e., Jungle).
    3. Header files from the other projects.
    4. C++ system header files.
    5. C system header files.
    • Note: alphabetical order within the same category.
    • Example (my_file.cc):
#include "my_file.h"            // Corresponding header file.

#include "table_file.h"         // Header files in the same project.
#include "table_helper.h"

#include "forestdb.h"           // Header files from the other projects.

#include <cassert>              // C++ header files.
#include <iostream>
#include <vector>

#include <sys/stat.h>           // C header files.
#include <sys/types.h>
#include <unistd.h>

License Information

Copyright 2017-2019 eBay Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

3rd Party Code

  1. URL: https://github.com/couchbase/forestdb
    License: https://github.com/couchbase/forestdb/blob/master/LICENSE
    Originally licensed under the Apache 2.0 license.

  2. URL: https://github.com/stbrumme/crc32
    Original Copyright 2011-2016 Stephan Brumme
    See Original ZLib License: https://github.com/stbrumme/crc32/blob/master/LICENSE

  3. URL: https://github.com/greensky00/simple_logger
    License: https://github.com/greensky00/simple_logger/blob/master/LICENSE
    Originally licensed under the MIT license.

  4. URL: https://github.com/greensky00/testsuite
    License: https://github.com/greensky00/testsuite/blob/master/LICENSE
    Originally licensed under the MIT license.

  5. URL: https://github.com/greensky00/latency-collector
    License: https://github.com/greensky00/latency-collector/blob/master/LICENSE
    Originally licensed under the MIT license.

  6. URL: https://github.com/eriwen/lcov-to-cobertura-xml/blob/master/lcov_cobertura/lcov_cobertura.py
    License: https://github.com/eriwen/lcov-to-cobertura-xml/blob/master/LICENSE
    Copyright 2011-2012 Eric Wendelin
    Originally licensed under the Apache 2.0 license.

  7. URL: https://github.com/bilke/cmake-modules
    License: https://github.com/bilke/cmake-modules/blob/master/LICENSE_1_0.txt
    Copyright 2012-2017 Lars Bilke
    Originally licensed under the BSD license.

  8. URL: https://github.com/aappleby/smhasher/tree/master/src
    Copyright 2016 Austin Appleby
    Originally licensed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].