Crux/Clojure training notes

Crux/Clojure training notes

I recently joined JUXT last month, which was fortunate timing because I was able to participate in four days of remote training sessions being delivered to a client.

As you may know if you follow this blog, JUXT has created an exciting database product called Crux. Various organisations are using Crux in production and many more are actively evaluating its capabilities. One such organisation asked for JUXT for training to bring the whole dev team up to speed with Crux, Clojure and GraphQL.

Bitemporal Training.

Armed with Visual Studio Code, the Calva extension and the all-powerful Clojure REPL, the JUXT training team—​which included a couple of the Crux core developers—​walked the attendees through the foundations of Clojure and Crux in just 3 days of training. I was very glad to be able to sit and learn new things along with the rest of the class!

Calva is an integrated REPL powered environment for enjoyable and productive Clojure and ClojureScript development in Visual Studio Code. It includes inline code evaluation, Paredit, code formatting, a test runner, syntax highlighting, linting, and more. Calva is open source and free to use.
— https://calva.io/

Using the combination of VS Code and Calva was valuable for making sure all attendees started the course on an equal footing. Similarly, the training course was delivered entirely through Microsoft Teams which proved an effective platform for managing large training sessions (10+ attendees on most days), recording the sessions and ease of use in the client’s corporate environment.

Calva Clojure Training.

Day 1

The course started with an intensive Clojure introduction from scratch. After making sure that everyone was up and running we had a look at the REPL, basic data structures and some of the most important functions from clojure.core. It was quite a nice refresher and I even learned something new like the reductions function (https://clojuredocs.org/clojure.core/reductions), which would have been very handy a few times during my Clojure career.

VS Code Clojure Training.

Day 2 (Intermediate Clojure)

During the second day, we looked at common idioms, error handling, unit testing, and Java interop.

We also covered multimethods and protocols.

The session concluded with an interesting Q&A from our attendees.

Clojure Training.

Day 3 (Crux data model, queries & API)

With everyone equipped with enough Clojure power in the morning, we tackled the Crux Tutorial, which thanks to the in-memory storage option, is just a breeze to try out in the REPL. This part of the course was led by Johanna Antonelli and Jeremy Taylor.

See just how easy is to create a Crux node and populate the database with an initial document:

(require '[crux.api :as c])

(def node (c/start-node {}))

(def manifest
  {:crux.db/id :manifest
   :pilot-name "Johanna"
   :id/rocket "SB002-sol"
   :id/employee "22910x2"
   :badges "SETUP"
   :cargo ["stereo" "gold fish" "slippers" "secret note"]})

(c/submit-tx node [[:crux.tx/put manifest]])
Crux Training.

Day 4 (Clojure + Crux Masterclass)

The last day was all hands-on, working on the Crux Shop repository, with Alex Davis and Jeremy Taylor. This repository is configured with a GraphQL server (with Lacinia), the Component library, and ready to be extended with further changes.

There were a few tasks which involved adding features with increasing difficulty, and I was impressed by how quickly our attendees managed to get things done.

Crux Topology Training.

Afterthoughts

It was great fun to join the training. It was good to engage with my colleagues who work on Crux - Crux is an absolute joy to work with, I’m very excited about its future.

Here is some more feedback from our attendees:

Clojure is not that scary at all

Crux is an amazing piece of tech. The day flew by!

Developers talking to developers.

Engaging smaller teams in practical exercises was great! Also, framing our training in OUR tech stack was also great.

Sounds interesting?

The great feedback from our attendees proved that doing a fully remote training session is not just feasible but productive and fun.

If you are interested in remote Crux training please check out the Crux training page.