Was learning about more back end stuff and came across event driven architecture
The basic gist of it is
Each service does its job.
Each service announces when it’s done.
Each service listens for the announcements it cares about.
No one service coordinates the others.
There’s no central “orchestrator” telling everyone what to do next.
The system behaves more like a collection of autonomous agents reacting to the world.
Responsibility is split cleanly.
The publisher must emit a clear, well-formed event.
The consumer must decide what this event means for its domain.
The architecture scales because nothing depends on the shape of a chain.
If tomorrow a new service needs to react to the same event, it just subscribes. No old service changes.
This seems a lot cleaner than the sequential or chronological stuff I have got going on
Integrating new features into that seems like a nightmare sometimes
Currently whatever I’ve got going on is manageable
But in future I think unless I have event driven architecture it will be a huge pain in ASS
I think refactoring can also be done more easily because of it because the split of responsibility establishes clear boundaries
Plus you can handle race conditions and stuff like that better because you start something only when you have received the clear green signal
Because most of the time race conditions are never about time but about causality that hey this happened and only after that something is supposed to happen so we are including this temporal buffer
A fundamental shift from “do this, then that, then that” to “here’s what happened, anyone who cares can react.”
Plus you can accommodate anyone who might care in future
because hey anyone can listen to a event and do stuff without disrupting others
It doesn’t matter if zero entities are listening or thousands, You can still get things working