Trakeva: Home

Trakeva

Transactions, Keys, and Values: an attempt at a generic interface for transactional key-value stores with different backends.

The interfaces are defined in the Trakeva module. We have, for now, one DB implementation of the module type Trakeva.KEY_VALUE_STORE:

There is also a very basic in “in-memory” cache functor, adding a cache layer on top of any key-value DB, cf. Trakeva_cache.

See also the repository smondet/trakeva for issues/questions.

Build

To install the libraries use opam:

opam install trakeva

If the packages sqlite3 and/or postgresql are installed, then the libraries trakeva_sqlite and/or trakeva_postgresql will be picked-up for installation too.

To build the development version from the repository, just run:

make configure
make

(this will enable all backends and the tests).

Tests

The tests/benchmarks also depend on the Sosa library (opam install sosa).

To run the unit tests:

./trakeva_tests

The main test starts a temporary Postgresql server on port 4242, this can be overridden with the environment variable POSTGRESQL_PORT. To use an existing database server instead of creating one use the variable POSTGRESQL_CONNECTION_INFO.

To run the benchmarks:

./trakeva_tests bench collection=100 kb=5     # quick bench
./trakeva_tests bench collection=1000 kb=20   # about a minute long

To build the documentation:

make doc

and checkout _doc/index.html.

Notes/Tips

Sqlite3 On MacOSX

See the issues #50, on the opam-repository and #21129 on Homebrew. So please use:

brew install pkg-config sqlite
export PKG_CONFIG_PATH=`find /usr/local/Cellar/sqlite -depth 1 | tail -n 1`/lib/pkgconfig
opam install sqlite3