All Projects → pinterest → Rocksplicator

pinterest / Rocksplicator

Licence: apache-2.0
RocksDB Replication

Labels

Projects that are alternatives of or similar to Rocksplicator

engine
Online 4X Grand Strategy RPG Engine
Stars: ✭ 19 (-95.81%)
Mutual labels:  rocksdb
rocks4j
KV Store for Java backed by RocksDB
Stars: ✭ 13 (-97.13%)
Mutual labels:  rocksdb
hexadb
A schemaless graph database based on RocksDb
Stars: ✭ 33 (-92.72%)
Mutual labels:  rocksdb
balboa
server for indexing and querying passive DNS observations
Stars: ✭ 42 (-90.73%)
Mutual labels:  rocksdb
distkv
Distributed KV Storage System based on Raft and RocksDB, can be use to store small files, like images.
Stars: ✭ 50 (-88.96%)
Mutual labels:  rocksdb
blockchain-node
A Helum Blockchain Node
Stars: ✭ 43 (-90.51%)
Mutual labels:  rocksdb
blackwidow
A library implements REDIS commands(Strings, Hashes, Lists, Sorted Sets, Sets, Keys, HyperLogLog) based on rocksdb
Stars: ✭ 40 (-91.17%)
Mutual labels:  rocksdb
Pika
Pika is a nosql compatible with redis, it is developed by Qihoo's DBA and infrastructure team
Stars: ✭ 4,439 (+879.91%)
Mutual labels:  rocksdb
toplingdb
ToplingDB is a cloud native LSM Key-Value Store with searchable compression algo and distributed compaction
Stars: ✭ 631 (+39.29%)
Mutual labels:  rocksdb
raft-rocks
A simple database based on raft and rocksdb
Stars: ✭ 38 (-91.61%)
Mutual labels:  rocksdb
quitsies
A persisted drop-in replacement for Memcached, respecting the rules of quitsies.
Stars: ✭ 16 (-96.47%)
Mutual labels:  rocksdb
pika
Pika is a nosql compatible with redis, it is developed by Qihoo's DBA and infrastructure team
Stars: ✭ 4,719 (+941.72%)
Mutual labels:  rocksdb
netty-chat-tutorial
Netty Chat tutorial with Protobuf
Stars: ✭ 23 (-94.92%)
Mutual labels:  rocksdb
database-engine
LSM-Tree Key-Value Store based on RocksDB
Stars: ✭ 47 (-89.62%)
Mutual labels:  rocksdb
Electrs
An efficient re-implementation of Electrum Server in Rust
Stars: ✭ 380 (-16.11%)
Mutual labels:  rocksdb
RocksServer
Flexible and fast server for RocksDB
Stars: ✭ 33 (-92.72%)
Mutual labels:  rocksdb
infinitree
Scalable and encrypted embedded database with 3-tier caching
Stars: ✭ 80 (-82.34%)
Mutual labels:  rocksdb
Middleware development learning
中间件、高性能服务器、分布式存储等(redis、memcache、nginx、大容量redis pika、rocksdb、mongodb、wiredtiger存储引擎、高性能代理中间件)二次开发、性能优化,逐步整理文档说明并配合demo指导--每周末定时更新2-3篇技术文章及程序demo--(技术交流QQ群:568892619)
Stars: ✭ 449 (-0.88%)
Mutual labels:  rocksdb
Geowave
GeoWave provides geospatial and temporal indexing on top of Accumulo, HBase, BigTable, Cassandra, Kudu, Redis, RocksDB, and DynamoDB.
Stars: ✭ 415 (-8.39%)
Mutual labels:  rocksdb
Kites
🪁 A consistency, partition tolerance completed distributed KV store, implementation of the Raft distributed consensus protocol and Kotlin.
Stars: ✭ 41 (-90.95%)
Mutual labels:  rocksdb

Rocksplicator

Build Status

Rocksplicator is a set of C++ libraries and tools for building large scale RocksDB based stateful services. Its goal is to help application developers solve common difficulties of building large scale stateful services, such as data replication, request routing and cluster management. With Rocksplicator, application developers just need to focus on their application logics, and won't need to deal with data replication, request routing nor cluster management.

Rocksplicator includes:

  1. RocksDB replicator (a library for RocksDB real-time data replication. It supports 3 different replication modes, i.e., async replication, semi-sync replication, and sync replication.)
  2. Helix powered automated cluster management and recovery
  3. Async fbthrift client pool and fbthrift request router
  4. A stats library for maintaining & reporting server stats
  5. A set of other small tool classes for building C++ services.

Online introduction videos

Introduction of Rocksplicator can be found in in our presentation at 2016 Annual RocksDB meetup at FB HQ and @Scale presentation (starting from 17:30).

Use cases

Currently, we have 9 different online services based on rocksplicator running at Pinterest, which consist of nearly 30 clusters, over 4000 hosts and process tens of PB data per day.

Prerequisities

The third-party dependencies of Rocksplicator can be found in docker/Dockerfile.

Get Started

Install docker

Docker is used for building Rocksplicator. Follow the Docker installation instructions to get Docker running on your system.

Build docker image

You can build your own docker image (if you want to change the docker file and test it locally).

cd docker && docker build -t rocksplicator-build .

Or pull the one we uploaded.

docker pull gopalrajpurohit/rocksplicator-build:librdkafka_1_4_0

Initialize submodules

cd rocksplicator && git submodule update --init

Build the libraries & tools

Get into the docker build environment. We are assuming the rocksplicator repo is under $HOME/code/, and $HOME/docker-root is an existing directory.

docker run -v <SOURCE-DIR>:/rocksplicator -v $HOME/docker-root:/root -ti gopalrajpurohit/rocksplicator-build:librdkafka_1_4_0 bash

Run the following command in the docker bash to build Rocksplicator:

cd /rocksplicator && mkdir -p build && cd build && cmake .. && make -j

Run Tests

Run the following command in the docker bash:

cd /rocksplicator && mkdir -p build && cd build && cmake .. && make -j && make test

How to build your own service based on RocksDB replicator & cluster management libraries.

There is an example counter service under examples/counter_service/, which demonstrated a typical usage pattern for RocksDB replicator.

Automated cluster management and recovery

Please check cluster_management directory for Helix powered automated cluster management and recovery.

Commands for cluster management (The following is for script driven cluster management, which has been deprecated)

The cluster mangement tool rocksdb_admin.py is under rocksdb_admin/tool/.

Before using the tool, we need to generate python client code for Admin interface as follows.

cd /rocksplicator/rocksdb_admin/tool/ && ./sync.sh

Create config file for a newly launched cluster.

host_file is a text file containing all hosts in the cluster. Each line is for a host in format "ip:port:zone". For example "192.168.0.101:9090:us-east-1c"

python rocksdb_admin.py new_cluster_name config --host_file=./host_file --segment=test --shard_num=1000 --overwrite

Ping all hosts in a cluster

python rocksdb_admin.py cluster_name ping

Remove a host from a cluster

python rocksdb_admin.py cluster_name remove_host "ip:port:zone"

Promote Master for shards currenty having Slaves only

python rocksdb_admin.py cluster_name promote

Add a host to a cluster

python rocksdb_admin.py cluster_name add_host "ip:port:zone"

Rebalance a cluster (Evenly distribute Masters)

python rocksdb_admin.py cluster_name rebalance

Load SST files from S3 to the cluster

python rocksdb_admin.py "cluster" load_sst "segment" "s3_bucket" "s3_prefix" --concurrency 64 --rate_limit_mb 64

Typical cluster management workflows (This has been deprecated, please check the new Helix powered solution in the cluster_management directory)

replacing a dead host

python rocksdb_admin.py cluster_name remove_host old_ip:old_port:zone_a
python rocksdb_admin.py cluster_name promote
python rocksdb_admin.py cluster_name add_host new_ip:new_port:zone_a
python rocksdb_admin.py cluster_name rebalance

License

Apache License, Version 2.0

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