Crux is becoming XTDB!

You can read the rename announcement, or head to this page on the new XTDB site (where you'll be taken in 10 seconds).


Kafka Nodes

When using Crux at scale it is recommended to use multiple Crux nodes connected via a Kafka cluster. Kafka can be used for both the Crux transaction log and the document store.

Local Cluster Mode

Kafka nodes have the following properties:

Table 1. Kafka node configuration
Property Description Default value


URL for connecting to Kafka



Name of Kafka transaction log topic



Name of Kafka documents topic



Option to automatically create Kafka topics if they do not already exist



Number of partitions for the document topic



Number of times to replicate data on Kafka



File to supply Kafka connection properties to the underlying Kafka API


Map to supply Kafka connection properties to the underlying Kafka API

Project Dependencies

  juxt/crux-core {:mvn/version "20.09-1.11.0-beta"}
  juxt/crux-kafka {:mvn/version "20.09-1.11.0-beta"}

Getting started

Use the API to start a Kafka node, configuring it with the bootstrap-servers property in order to connect to Kafka:

(defn start-cluster [kafka-port storage-dir]
  (crux/start-node {:crux.node/topology '[crux.kafka/topology crux.kv.rocksdb/kv-store]
                    :crux.kafka/bootstrap-servers (str "localhost:" kafka-port)
                    :crux.kv/db-dir (io/file storage-dir "indexes")}))
If you don’t specify kv-store then by default the Kafka node will use RocksDB. You will need to add RocksDB to your list of project dependencies.

You can later stop the node if you wish:

(.close node)