项目作者: profanedb

项目描述 :
A Protocol Buffers database
高级语言: C++
项目地址: git://github.com/profanedb/ProfaneDB.git
创建时间: 2017-05-05T07:29:38Z
项目社区:https://github.com/profanedb/ProfaneDB

开源协议:GNU General Public License v3.0

下载


ProfaneDB

ProfaneDB is a database for Protocol Buffer objects.
The key used for retrieval of objects is defined within .proto files, this is then used to store a single copy of each object, and allow references between objects without data duplication.

Configuration and usage

For a more detailed explanation, go to the project’s website.

Schema definition

Schema definition comes with every message definition, using Protocol Buffer field options:

At the moment only one key per message can be set

  1. import "profanedb/protobuf/options.proto";
  2. message Test {
  3. int32 field_one_int = 1 [ (profanedb.protobuf.options).key = true ];
  4. string field_two_str = 2;
  5. bool field_three_bool = 3;
  6. bytes field_four_bytes = 4;
  7. Nested field_five_nested = 5;
  8. }
  9. message Nested {
  10. string nested_field_one_str = 1 [ (profanedb.protobuf.options).key = true ];
  11. int64 nested_field_two_int = 2;
  12. double nested_field_three_double = 3;
  13. }

ProfaneDB can either be used as a gRPC server (service definition in profanedb/protobuf/db.proto) or as a library (interface in profanedb/db.hpp).

CLI parameters

  1. profanedb_server --rocksdb_path /tmp/profanedb -I /usr/include -S /your/schema/dir

The most important parameters are the include path (-I) and schema path (-S).

  • The include path is used to retrieve google/protobuf/*.proto,
    profanedb/protobuf/*.proto and any other dependencies.
  • The schema path has your definitions with the key option set.

Build

ProfaneDB uses CMake, and depends on Protobuf, gRPC, RocksDB, Boost.

Options

CMake Option Default Description
BUILD_SHARED_LIBS ON Build libprofanedb.so, to embed ProfaneDB
BUILD_PROFANEDB_SERVER OFF Build ProfaneDB gRPC server
BUILD_TESTS OFF Build tests, run with ctest