From REST to CQRS with Clojure, Kafka, & Datomic
summary
Shows a concrete CQRS implementation built with Clojure microservices: a thin HTTP layer that writes domain commands into a Kafka command log, Samza jobs that process pending → accepted/failed streams, and Datomic materialized views queried over HTTP with websocket updates. The client library is three functions (send command, query, subscribe). Demo performs async 202 and optional sync responses, scales reads/writes separately, and replaces hundreds of REST endpoints with three endpoints while preserving audit/replay.
AI-written summary · about
chapters (25)
- 0:00Intro
- 0:58Who am I?
- 2:23How to proceed?
- 2:55How not to proceed
- 3:42Goal
- 4:27Organizational Scale
- 5:25HTTP API Proliferation
- 6:21Teams Reinvent Wheels
- 9:03Ideal State
- 11:12The Good Parts
- 15:10All the cool kids are doing it!
- 16:42Back into the Tarpit
- 18:26The Kingdom of Nouns for Distributed Systems
- 20:54Operationally rigid
- 22:41Hard to extend or integrate
- 23:47Obscures the story
- 24:34What is CQRS?
- 25:07CQRS Baggage
- 27:08What is Event Sourcing?
- 27:54Datomic was CORS+ES before it was cool • Datomic follows a CORS design pattern with Event Sourcing, whence much of the goodness
- 28:47Why might I use Event Sourcing?
- 32:11Update
- 41:50Simplifies Client Development
- 42:07Reifies customer intent . Command events are front and center in development
- 43:55References and Inspiration
related talks
43mCommander: Better Distributed Applications through CQRS and Event Sourcing
46mTame Kafka streams with Clojure
43mDatalog all the way down
43mKey-Value, Event-Sourcing, Cqrs, Pub/Sub as a Service, Java, Javascript
36mLiterate Stream Processing
32mClojure is a Foreign Country: Combining Datomic with Scala
52mFull stack FP in Datomic, Clojure, and ClojureScript
42mCQRS and Event Sourcing with Lagom
