10 breaking releases

✓ Uses Rust 2018 edition

0.22.0 Aug 13, 2019
0.21.0 Nov 17, 2018
0.20.0 Nov 8, 2018
0.15.0 Jun 11, 2018
0.12.1 Mar 1, 2018

#92 in Database interfaces

Download history 2/week @ 2019-04-30 12/week @ 2019-05-07 15/week @ 2019-05-14 21/week @ 2019-05-21 37/week @ 2019-05-28 22/week @ 2019-06-04 12/week @ 2019-06-11 38/week @ 2019-06-18 131/week @ 2019-06-25 49/week @ 2019-07-02 40/week @ 2019-07-09 11/week @ 2019-07-16 17/week @ 2019-07-30 23/week @ 2019-08-06

135 downloads per month

MPL-2.0 license

200KB
4.5K SLoC

IndraDB Build Status

A graph database written in rust. This software is in the alpha state.

IndraDB consists of a server and an underlying library. Most users would use the server, which is available via releases as pre-compiled binaries. But if you're a rust developer that wants to embed a graph database directly in your application, you can use the library.

Features

  • Support for directed and typed graphs.
  • Support for queries with multiple hops.
  • Cross-language support via Cap'n Proto, or direct embedding as a library.
  • Support for JSON-based properties tied to vertices and edges.
  • Pluggable underlying datastores, with built-in support for in-memory-only and rocksdb. Postgresql is available separately.
  • Written in rust!

IndraDB's original design is heavily inspired by TAO, facebook's graph datastore. In particular, IndraDB emphasizes simplicity of implementation and query semantics, and is similarly designed with the assumption that it may be representing a graph large enough that full graph processing is not possible. IndraDB departs from TAO (and most graph databases) in its support for properties.

For more details, see the homepage.

Getting started

This should start an in-memory-only datastore, where all work will be wiped out when the server is shutdown. You can persist your work with one of the alternative datastores.

In-memory

By default, IndraDB starts an in-memory datastore that does not persist to disk. This is useful for kicking the tires. If you want to use the in-memory datastore, do not set the DATABASE_URL, or just set it to memory://. e.g.: DATABASE_URL=memory:// indradb

RocksDB

If you want to use the rocksdb-backed datastore, set the DATABASE_URL environment variable; e.g.: DATABASE_URL=rocksdb://database.rdb indradb.

Environment variables

Applications are configured via environment variables:

  • DATABASE_URL: The connection string to the underlying database.
  • PORT: The port to run the server on. Defaults to 27615.
  • WORKER_COUNT: How many worker threads to have to satisfy client requests. Defaults to twice the number of CPUs.

Additional environment variables available when using the RocksDB datastore:

  • ROCKSDB_MAX_OPEN_FILES: Sets the number of maximum open files to have open in RocksDB.
  • ROCKSDB_BULK_LOAD_OPTIMIZED: If set to true, RocksDB will be configured to optimize for bulk loading of data, likely at the detriment of any other kind of workload.

Install from source

If you don't want to use the pre-built releases, you can build/install from source:

  • Install rust. IndraDB should work with any of the rust variants (stable, nightly, beta.)
  • Make sure you have gcc 5+ installed.
  • Clone the repo: git clone git@github.com:indradb/indradb.git.
  • Build/install it: cargo install.

Running tests

Use make test to run the test suite. Note that this will run the full test suite across the entire workspace, including tests for all datastore implementations. Similarly, you can run make bench to run the full benchmarking suite.

You can filter which tests run via the TEST_NAME environment variable. e.g. TEST_NAME=create_vertex make test will run tests with create_vertex in the name across all datastore implementations.

Dependencies

~27MB
~552K SLoC