My Authors
Read all threads
After several discussions about event sourcing today, I think it's time to clarify things. Thread ⬇ 1/8
When talking about Query eventual consistency, views autorebuild with 0 downtime deployment, snapshots, automatic failover, we're in the Advanced Non Functional Requirements column with high availability, low latency, distributed systems, so infra is advanced and non obvious 2/8
This is normal, you cannot have high quality of service under scale and hope it will work like magic. You'll have to solve some problems, and all solutions will not be obvious. Distributed systems are hard. 3/8
But many systems don't need it (like my implementation of Crazy Farmers on @boardgamearena ) and will have very simple (200LoC) infra code.
Load events fold them, decide new events, save events. Compute projections synchronously. 4/8
You can even save state.
load state, get new events using the decide function and the command, compute new state with evolve, save state.
Save events for trace and maybe state rebuild. 5/8
You can notice that in both case, domain code is "Essential Complexity"...
Your domain is in the functions. As long as it provides the right signature, the domain complexity doesn't leak to the infra code. A change in the domain code, doesn't change the signature 6/8
The infra code only has access to the signature. It can run any code that takes a state and a command to return a list of event, and a state and an event to return a new state.
Whatever Event, Command, State, decide or evolve mean. 7/8
You can then evolve the domain for functional needs without touching the infra.
You can evolve the infra code for non functional needs without touching the domain.

This is less friction as your system is evolving over time. 8/8
To be accurate there can be other functions than the 2 presented here, but all have signature involving generic Commands, States and Events:
projection: State -> Event -> State
translation: Event list -> Event list
reaction: State -> Event -> Command or Event -> State -> Command
Missing some Tweet in this thread? You can try to force a refresh.

Keep Current with Jérémie Chassaing @home 🧠👉🏻💻

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!