Flexible and fast server for RocksDB
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.


#RocksServer is server for RocksDB

Supports the following operations:

operations description
Get Get value by key
Multi get Get values by keys
Set Set value by key
Multi set Set values by keys
Delete key Delete key from DB
Multi delete keys Delete keys from DB
Check key exist Check key existing
Imcrement Imcrement value by key
Prefit Prefix iterator

For more details see: protocol description

##Dependency RocksDB, LibEvent

The compiler should support C++11

Install & Run

First install RocksDB dependences:

sudo apt-get install libsnappy-dev
sudo apt-get install zlib1g-dev
sudo apt-get install libbz2-dev.
sudo apt-get install libgflags-dev

Then clone the repository:

git clone --recursive https://github.com/valmat/RocksServer
cd RocksServer


git clone https://github.com/valmat/RocksServer
cd RocksServer
git submodule update

After then compile dependencies:



cd src

After: edit config.ini and run

./RocksServer.bin config.ini

Or you can install it:

switch to root and run

make install


Exemple of usage: driver for php Or any your own implementation by protocol description.

How to extend

First you need implement your own request listener. To do this, you should to implement the interface

template<typename ProtIn, typename ProtOut>
struct RequestBase: public RequestSuperBase
    virtual void run(const ProtIn &, const ProtOut &) = 0;

For example: RequestPing.h

struct RequestPing : public RequestBase<ProtocolInTrivial, ProtocolOut>
    virtual void run(const ProtocolInTrivial &in, const ProtocolOut &out) override

After that, you need to implement a plugin: smpl_plug.cpp

#include <rocksserver/api.h>
#include "RequestPing.h"

PLUGIN(Extension &extension)
    extension.bind("/ping", new RequestPing());

Compile your plugin:

g++ -I. -I"/usr/include/rocksserver/include" -Wall -O3 -std=c++11 -fPIC -c smpl_plug.cpp -o smpl_plug.o 
g++ -Wall -std=c++11 -O3 -shared smpl_plug.o -o smpl_plug.so

and copy to /usr/lib/rocksserver/plugins

cp -f smpl_plug.so /usr/lib/rocksserver/plugins/smpl_plug.so

Restart RocksServer. See example how to extend RocksServer.

How to customize

Just edit config.ini