Skip to content

Graph Storage

Where the products keep the graph decides whether it survives a restart and whether you can run a cluster. services.persistor chooses one of three:

Choice Where the graph lives Survives a restart Use it for
cassandra A local Cassandra container, one keyspace per product Yes What quinectl init writes; required for a cluster
rocks-db Files in your project directory Yes A single member without a Cassandra container
in-memory The product's memory No Quick experiments you'll throw away

Cassandra and RocksDB each have a short form and a long form. The long form shows every setting at its default.

Cassandra

quinectl.yaml
quine:
  edition: enterprise
  licenseKey: ${QE_LICENSE_KEY}
  customerId: ${QE_CUSTOMER_ID}
services:
  persistor: cassandra
  auth: keycloak
  proxy: none
  metrics: none
  kafka: none
quinectl.yaml
quine:
  edition: enterprise
  licenseKey: ${QE_LICENSE_KEY}
  customerId: ${QE_CUSTOMER_ID}
services:
  persistor:
    cassandra:
      image: cassandra:4.1
      cqlPort: 9042
      heap: 1G
  auth: keycloak
  proxy: none
  metrics: none
  kafka: none

Set these before Cassandra first starts.

Changing image or cqlPort empties every graph

If you change image or cqlPort later, the next up replaces the Cassandra container without asking. The graphs of every project on this machine are empty afterwards.

heap applies only when the container is created. Changing it later has no effect.

quinectl starts a Cassandra container, quinectl-cassandra, on CQL port 9042 and waits until it answers before launching anything. Each product stores its graph in its own keyspace: quine for Quine Enterprise and novelty for Novelty, unless you set quine.keyspace or novelty.keyspace.

The container is shared by every project on the machine, and keeps running when you run quinectl down, so the graph is still there next time. quinectl down --rm, run after quinectl down, removes the container, and the next up starts with an empty graph. Give each project its own keyspace; see Multi-tenancy.

RocksDB

quinectl.yaml
quine:
  edition: enterprise
  licenseKey: ${QE_LICENSE_KEY}
  customerId: ${QE_CUSTOMER_ID}
services:
  persistor: rocks-db
  auth: keycloak
  proxy: none
  metrics: none
  kafka: none
quinectl.yaml
quine:
  edition: enterprise
  licenseKey: ${QE_LICENSE_KEY}
  customerId: ${QE_CUSTOMER_ID}
services:
  persistor:
    rocksDb:
      filepath: quine.db
      createParentDir: false
      writeAheadLog: true
      syncAllWrites: false
  auth: keycloak
  proxy: none
  metrics: none
  kafka: none

No storage container runs. Each product writes its graph to a directory in your project: quine.db/ for Quine Enterprise and novelty.db/ for Novelty. The graph is kept when the product stops: after quinectl down and quinectl up, it is still there.

  • The long form's key is rocksDb, not rocks-db.
  • filepath puts the graph somewhere else, in a project that runs one product. With both products, quinectl refuses it.
  • With runtime: docker, a missing directory is created for you.

RocksDB is for a single member. A cluster with more than one member needs Cassandra, and quinectl refuses the combination before starting anything.

In-memory

Keep the graph in the product's memory:

quinectl.yaml
quine:
  edition: enterprise
  licenseKey: ${QE_LICENSE_KEY}
  customerId: ${QE_CUSTOMER_ID}
services:
  persistor: in-memory
  auth: keycloak
  proxy: none
  metrics: none
  kafka: none

Nothing is written anywhere. The graph is gone when the product stops.

Starting over with an empty graph

quinectl cass-reset deletes this project's keyspaces on Cassandra, both Quine Enterprise's and Novelty's, so the next up starts with an empty graph. Other projects' keyspaces on the same Cassandra are left alone. Two projects on the same keyspace share one graph, so while another project directory declares this project's keyspace, cass-reset refuses, names that directory, and deletes nothing. Give one of them its own keyspace first. It asks before deleting; --yes skips the question, and is required in a script.

Stop the products, reset, and start again:

quinectl down
quinectl cass-reset
quinectl up

For RocksDB, stop the products and delete their RocksDB directories. In-memory storage starts empty every time.

Next steps

  • To run several projects on one Cassandra, each with its own keyspace, see Multi-tenancy.
  • To remove the Cassandra container and the other shared containers, see Stopping and removing.