Fork me on GitHub
#clojure-europe
<
2024-05-07
>
schmalz06:05:37

Morning all.

plexus06:05:47

goeiemorgen!

genRaiy07:05:55

⚙️ good morning ⚙️

dharrigan07:05:28

Good Morning!

maleghast08:05:32

madainn mhath :flag-scotland:

imre11:05:02

jó reggelt

otfrom13:05:35

does anyone here do event sourcing and/or CQRS with clojure?

otfrom13:05:35

was reading some interesting stuff on event sourcing katas in Java 22 and was thinking about doing it in clojure and just wondering what the differences might be and whether or not I'd use core.async/atoms/external db or queue or other

Ben Sless13:05:56

It's fun to event source over something reducible. Clojure fits this quite nicely

daveliepmann15:05:04

> event sourcing katas in Java 22 sounds like a fun read

otfrom15:05:27

And, yeah, event sourcing is just the result of a reduce on the events

Ben Sless15:05:05

I had fun one evening turning on all experimental features and trying to implement Monads with Java to make everyone angry 😅

😄 1
simongray05:05:51

The big government project I used to work on with @U0AQ3HP9U and @U054UD60U uses event sourcing and CQRS. We had a pretty bespoke solution, but it worked pretty well as far as I can remember. It's been more than 4 years since I left, though.

simongray06:05:02

The thing I remember the most is having a huge layer between the data store and the application later to apply sequential transformations to events since the underlying data model changed many times during the development phase.

simongray06:05:44

So events over time persisted in various states of the ever changing data model.

jasonbell06:05:03

Cough cough…. Apache Pulsar 😉

ordnungswidrig07:05:58

I was looking at event sourcing on and off when exploring the world of offline-first and p2p systems. I came to the conclusion that for a decentralized p2p system you eventually need an event bases system to reason about the intention of the contributor.

otfrom07:05:29

I think offline first P2P needs CRDTs instead. I've been thinking about that with LoRa and mesh networking

helios07:05:19

A long time ago with @U09N5N31T , @U1AS6PFGX we did https://github.com/rill-event-sourcing/rill and used it in production for a few years before the company pivoted and the clojure software was scrapped. A few billion events, and a fun architecture

❤️ 2
helios07:05:16

In a subsequent project we did another take on it, with https://github.com/rill-event-sourcing/wheel 😄

❤️ 2
helios07:05:48

Nowadays with the folks of Nextjournal (cc @U5H74UNSF) we're not far away from it architecture-wise, but not a strict event-sourcing with CQRS as those two projects. 😄

joost-diepenmaat08:05:59

We too. As @U0AD3JSHL said we did a bunch of fairly “pure” event sourcing projects and it does have a few nice advantages. Looking back I’d probably do something a little less pure and take more advantages of existing database engines

👍 1
otfrom08:05:04

@U09N5N31T existing database engines like postgres or other?

helios08:05:03

For a project with nextjournal we're using datomic and for some parts of the application we're not doing event-sourcing, so regular datomic stuff applies, and for other parts we're saving 'events' as simpler datomic entities.

Ben Sless10:05:11

One thing @U4P4NREBY's anecdote reminds me - even sourcing without generational versioning is a recipe for pain (then your reader just promotes old generations on read, it's fun, building a ladder)

👍 2
1
ordnungswidrig12:05:48

I don't remember how it worked but there are two ways, right? 1. convert old events to the new version on read from event store 2. make your processors handle old and new events.

ordnungswidrig12:05:01

Not sure what is worst, maybe it's a solid "it depends"

👍 1
ordnungswidrig12:05:01

I wonder how to take into account missing information which would require access to other entities / the current state? thinking-face

reefersleep18:05:16

We apply brain mass whenever considering to promote old stuff. If data is missing, can't be done, create a new event type instead.

reefersleep18:05:50

As faulty a process as any other where brain mass is applied 😊

joost-diepenmaat18:05:51

@U0525KG62 Both regular relational/sql databases like Postgres and in memory databases like datascript. I think we underestimated the challenges of projecting events to entities and doing queries on entities/relations.

ordnungswidrig13:05:45

A lot of challenges where underestimated 😛

otfrom13:05:25

👍 2
😁 3