Version 2.3.1
LevelDB compatibility API

WiredTiger includes an implementation of the LevelDB API to ease integration and performance testing with existing applications.

Building and using WiredTiger's LevelDB API

Here are the steps to build and run an existing application against WiredTiger's LevelDB API:

  1. choose an installation directory for WiredTiger. The default is:

    WT_INSTALL=/usr/local

    but anywhere is fine.

  2. build WiredTiger with LevelDB support:

    ./configure –enable-leveldb –with-builtins=snappy –prefix=$WT_INSTALL make install

    To include support for Basho's version of LevelDB, change the above to –enable-leveldb=basho. To include support for HyperLevelDB / HyperDex, change the above to –enable-leveldb=hyper. To include support for RocksDB, change the above to –enable-leveldb=rocksdb.

  3. compile and link the application against WiredTiger's LevelDB API:

    ./configure CPPFLAGS="-I$WT_INSTALL/include/wiredtiger" LDFLAGS="-L$WT_INSTALL/lib/wiredtiger" ... && make

  4. start the application:

    LD_LIBRARY_PATH=$WT_INSTALL/lib/wiredtiger <normal start command>

Caveats

The core LevelDB features are well supported, though some configuration options may be ignored. In the extended versions of the API, some rarely used features have not been implemented, and will cause either build or runtime errors.

The WiredTiger on-disk format is not compatible with LevelDB. Data will need to be dumped and reloaded by the application.

The WiredTiger LevelDB API is not guaranteed to be binary compatible with LevelDB. We do not support using LD_PRELOAD to switch an existing binary built with stock LevelDB to WiredTiger without compiling against the installed include files.