Installation
XTDB nodes can be embedded within your JVM application, or they can be started standalone through a pre-built XTDB JAR, via Docker, or using Clojure CLI tooling.
This guide will show you how to set up an in-memory node using the core
module.
You can then proceed to add further modules (eg for persistence) as required - see the documentation of the individual modules for more information.
Within your JVM application
First, add the core
module as a project dependency.
We can then start up an in-memory XTDB node with:
Using a pre-built XTDB JAR
You can start a standalone XTDB node, accessible through HTTP, using a pre-built XTDB JAR.
XTDB pre-built JARs can be found on the relevant GitHub releases page - we’ll use xtdb-in-memory.jar
.
Start it in the usual way, with java -jar xtdb-in-memory.jar
.
This will open an HTTP port with a console UI on port 3000 - open http://localhost:3000 in your favourite browser.
You can also build custom XTDB JARs with your choice of modules - see the XTDB build blog post for more details.
Via Docker
You can also start a standalone XTDB node using Docker, using:
docker run -p 3000:3000 juxt/xtdb-in-memory:1.22.0
Again, this opens up an HTTP server at http://localhost:3000.
Likewise, you can build custom XTDB Docker images - see the XTDB build blog post for more details.
Clojure CLI tooling
Similarly, to start XTDB using Clojure’s CLI tooling:
{:deps {org.clojure/clojure {:mvn/version "1.10.3"}
com.xtdb/xtdb-core {:mvn/version "1.22.0"}
com.xtdb/xtdb-http-server {:mvn/version "1.22.0"}}}
Then, start the node with clojure -m xtdb.main
.
You can get a listing of CLI flags using clojure -m xtdb.main -h
.