mugabe / couchbase-cbforest

C++ wrapper library around ForestDB, for use in Couchbase Lite.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CBForest is a higher-level C and C++ wrapper around ForestDB, a new key-value storage engine based on a hierarchical B+-tree trie data structure. ForestDB is similar in functionality to the CouchStore engine that currently underlies Couchbase Server, but it should be faster and more space-efficient, especially on solid-state disks (SSDs).

CBForest adds an idiomatic object-oriented C++ API for ForestDB, and also some new functionality (see below.) Recently a C API with the same functionality has been added, and Java and C# bindings to that C API.

The immediate purpose of CBForest is to serve as the storage engine of the next generation of Couchbase Lite (on all platforms), replacing SQLite. But it may find other uses too, perhaps for applications that want a fast minimalist data store with map/reduce indexing, but don't need any of the fancy features of Couchbase Lite like replication.

Features

  • ForestDB features, available via idiomatic C++, Java and C# APIs:

    • Fast key-value storage, where keys and values are both opaque blobs.
    • Extremely robust append-only file format with write-ahead log and automatic compaction.
    • Reads are never blocked, even while writes or transactions are in progress.
    • Iteration by key order.
    • Iteration by sequence, reflecting the order in which changes were made to the database. (This is useful for tasks like updating indexes and replication.)
    • Database encryption using AES-256.
  • New features implemented by CBForest:

    • Optional multi-version document format that keeps a revision tree of the history of each document (as in Couchbase Lite or CouchDB.)
    • Index API that uses a database as an index of an external data set.
    • Map-reduce indexes that update incrementally as documents are changed in the source DB (as in Couchbase Lite or CouchDB.)
    • Limited full-text indexing.
    • Limited geo-indexing.
    • Support for JSON-compatible structured keys in indexes, sorted according to CouchDB's JSON collation spec.

Platform Support

CBForest runs on Mac OS, iOS, tvOS, Android, various other flavors of Unix, and Windows.

CBForest has been in use since mid-2015 in the iOS/Mac version of Couchbase Lite 1.1, and since early 2016 in the 1.2 release on all the above platforms.

License

Like all Couchbase source code, this is released under the Apache 2 license.

About

C++ wrapper library around ForestDB, for use in Couchbase Lite.


Languages

Language:C++ 33.0%Language:Objective-C 29.7%Language:C# 20.2%Language:C 6.8%Language:Objective-C++ 5.6%Language:Java 3.5%Language:Makefile 1.0%Language:Shell 0.1%