Skip to content

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
                    }]}

S3

Main article: S3

{:storage [:remote
           {:object-store [:s3
                           {;; -- required
                            :bucket "my-bucket"
                            :sns-topic-arn "arn:aws:sns:region:account-id:my-sns-topic"

                            ;; -- optional

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

Azure Blob Storage

Main article: Azure Blob Storage

{:storage [:remote
           {:object-store [:azure
                           {;; -- required
                            :storage-account "storage-account"
                            :container "xtdb-container"
                            :service-bus-namespace "xtdb-service-bus"
                            :service-bus-topic-name "xtdb-service-bus-topic"

                            ;; -- optional

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

Google Cloud Storage

Main article: Google Cloud Storage

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

                            ;; -- optional

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

Optional Modules

HTTP Server

Main article: HTTP Server

{:http-server {;; -- optional

               ;; :port 3000
              }}