Cayley can be configured using configuration file written in YAML / JSON or by passing flags to the command line. By default. All command line flags take precedence over the configuration file.
By default, Cayley is using the
memstore works best for datasets that can fit into the memory of the machine and workloads which doesn't require persistency. For large datasets and/or workloads with require persistency it is recommended to use the
Determines the type of the underlying database. Options include:
memstore: An in-memory store, based on an initial N-Quads file. Loses all changes when the process exits.
btree: An in-memory store, used mostly to quickly verify KV backend functionality.
leveldb: A persistent on-disk store backed by LevelDB.
bolt: Stores the graph data on-disk in a Bolt file. Uses more disk space and memory than LevelDB for smaller stores, but is often faster to write to and comparable for large ones, with faster average query times.
Slower, as it incurs network traffic, but multiple Cayley instances can disappear and reconnect at will, across a potentially horizontally-scaled store.
mongo: Stores the graph data and indices in a MongoDB instance.
elastic: Stores the graph data and indices in a ElasticSearch instance.
couch: Stores the graph data and indices in a CouchDB instance.
postgres: Stores the graph data and indices in a PostgreSQL instance.
cockroach: Stores the graph data and indices in a CockroachDB cluster.
sqlite: Stores the graph data and indices in a SQLite database.
Where does the database actually live? Dependent on the type of database. For each datastore:
memstore: Path parameter is not supported.
leveldb: Directory to hold the LevelDB database files.
bolt: Path to the persistent single Bolt database file.
mongo: "hostname:port" of the desired MongoDB server. More options can be provided in mgo address format.
http://host:port of the desired ElasticSearch server.
http://user:[email protected]:port/dbname of the desired CouchDB server.
filepath of the SQLite database. More options available on driver page.
If true, disables the ability to write to the database using the HTTP API (will return a 400 for any write request). Useful for testing or instances that shouldn't change.
See Per-Database Options, below.
store.options object in the main configuration file contains any of these following options that change the behavior of the datastore.
No special options.
The size in MiB of the LevelDB write cache. Increasing this number allows for more/faster writes before syncing to disk. Default is 20, for large loads, a recommended value is 200+.
The size in MiB of the LevelDB block cache. Increasing this number uses more memory to maintain a bigger cache of quad blocks for better performance.
Optionally disable syncing to disk per transaction. Nosync being true means much faster load times, but without consistency guarantees.
The name of the database within MongoDB to connect to. Manages its own collections and indices therein.
Postgres version 9.5 or greater is required.
Amount of empty space as a percentage to leave in the database when creating a table and inserting rows. See PostgreSQL CreateTable.
Whether to skip checking quad store size.
Connection pooling options used to configure the Go sql connection. Go defaults will be used when not specified.
replication_options object in the main configuration file contains any of these following options that change the behavior of the replication manager.
Type: Integer or String
Optionally ignore missing quad on delete.
Optionally ignore duplicated quad on add.
The number of quads to buffer from a loaded file before writing a block of quads to the database. Larger numbers are good for larger loads.
Cayley looks in the following locations for the configuration file (named
Command line flag
The environment variable