Datomic is a distributed, general-purpose database that provides immutability, time-aware data access, and strong ACID guarantees. The Amazing Day of Datomic is an interactive workshop designed to teach you these fundamentals and help you get hands-on experience with Datomic.
Inside the src
directory, you'll find three Clojure files:
- petshop.clj – The main file used in the workshop. It walks through basic Datomic operations such as creating a database, performing transactions, and running queries.
- music_brainz.clj – Contains more complex query examples. To run it, you'll need to restore the MusicBrainz sample database. See how to do this in the Database Sample section.
- partitions.clj – Demonstrates how to use implicit partitions in Datomic and discusses the performance implications.
Follow the official instructions to install Clojure for your operating system:
https://clojure.org/guides/install_clojure
You'll also need to have Java installed.
Download Datomic Pro from:
https://docs.datomic.com/setup/pro-setup.html#get-datomic
For this workshop, you’ll run a dev mode transactor locally.
Dev mode uses local disk storage and requires a transactor process to be running:
https://docs.datomic.com/setup/pro-setup.html#starting-a-transactor
You can use your preferred IDE or run the Datomic REPL directly.
If you don’t have a development environment set up, Datomic provides a REPL distribution.
With the transactor running, open another terminal tab, navigate to the config
directory of your Datomic Pro distribution, and run:
bin/repl
You can also run the examples in your favorite editor:
Here you can learn how to connect to a database:
https://docs.datomic.com/peer-tutorial/connect-to-a-database.html
Connection instructions are also included in the workshop source code.
To use a sample database, follow the tutorial below using only the Getting the Data section of the mbrainz-sample repository.
- Run the commands in a separate terminal tab too.
- Datomic Documentation – Official Datomic documentation.
- Learn Datalog Today – an interactive tutorial on Datalog query language the one used by Datomic
- Max Datom – An interactive Datomic tutorial with exercises and visualizations.
- Learn by Example – Build a simple TODO app using Datomic to learn by doing.
- Original Day of Datomic Repository – The original Day of Datomic repo, with additional examples and exercises.
- Original Day of Datomic Video Recording – Recording of the original Day of Datomic presentation.
- Clojure Official Website – The official Clojure language website.
- 4Clojure – Solve small coding problems interactively to practice Clojure.
- Try Clojure – An interactive REPL to learn the basics of Clojure online.
- Brave Clojure – A free, beginner-friendly online book to learn Clojure, with practical examples and explanations.
For questions or feedback about the tutorials, please create an issue.