Skip to content

Clojure Configuration Cookbook

This document provides examples for the EDN configuration of XTDB components, to be supplied to xtdb.api/start-node.

Transaction Log

Main article: Transaction Log

In-Memory

This is the default, and can be omitted.

{:log [:in-memory
       {;; -- optional

        ;; :instant-src (java.time.InstantSource/system)
        }]}

Local disk

{:log [:local
       {;; -- required
        ;; accepts `String`, `File` or `Path`
        :path "/tmp/tx-log"

        ;; -- optional

        ;; accepts `java.time.InstantSource`
        ;; :instant-src (InstantSource/system)

        ;; :buffer-size 4096
        ;; :poll-sleep-duration "PT1S"
        }]}

Kafka

Main article: Kafka

{:log [:kafka
       {;; -- required
        :bootstrap-servers "localhost:9092"
        :topic-name "xtdb-log"

        ;; -- optional

        ;; :create-topic? true
        ;; :poll-duration #time/duration "PT1S"
        ;; :properties-file "kafka.properties"
        ;; :properties-map {}
        ;; :replication-factor 1
        ;; :topic-config {}
        }]}

Storage

Main article: Storage

In-Memory

Main article: in-memory storage

This is the default, and should be omitted.

Local disk

Main article: local-disk storage

{:storage [:local
           {;; -- required

            ;; accepts `String`, `File` or `Path`
            :path "/var/lib/xtdb/storage"

            ;; -- optional

            ;; :max-cache-bytes 1024
            ;; :max-cache-entries 536870912
           }]}

Remote

Main article: remote storage

{:storage [:remote {;; -- required

                    ;; Each object store implementation has its own configuration -
                    ;; see below for some examples.
                    :object-store [:object-store-implementation {}]

                    ;; accepts `String`, `File` or `Path`
                    :local-disk-cache "/tmp/local-disk-cache"

                    ;; -- optional
                    ;; :max-cache-entries 1024
                    ;; :max-cache-bytes 536870912
                    ;; :max-disk-cache-percentage 75
                    ;; :max-disk-cache-bytes 107374182400
                    }]}

S3

Main article: S3

{:storage [:remote
           {:object-store [:s3
                           {;; -- required
                            :bucket "my-bucket"

                            ;; -- optional

                            ;; :prefix "my-xtdb-node"
                            ;; :configurator (reify S3Configurator
                            ;;                 ...)
                           }]}]}

Azure Blob Storage

Main article: Azure Blob Storage

{:storage [:remote
           {:object-store [:azure
                           {;; -- required
                            ;; --- At least one of storage-account or storage-account-endpoint is required
                            :storage-account "storage-account"
                            ;; :storage-account-endpoint "https://storage-account.privatelink.blob.core.windows.net"
                            :container "xtdb-container"

                            ;; -- optional

                            ;; :prefix "my-xtdb-node"
                            ;; :user-managed-identity-client-id "user-managed-identity-client-id"
                           }]}]}

Google Cloud Storage

Main article: Google Cloud Storage

{:storage [:remote
           {:object-store [:google-cloud
                           {;; -- required
                            :project-id "xtdb-project"
                            :bucket "xtdb-bucket"

                            ;; -- optional

                            ;; :prefix "my-xtdb-node"
                           }]}]}