Event-Driven Application Design, Done Properly
Structuring applications so actions publish events that other parts of the system react to.
On this page
What is at stake
Events decouple features, but they also make execution order and failures harder to follow.
The playbook
- Use events for genuine side effects
- Queue slow listeners
- Log event handling for traceability
- Keep listeners idempotent
- Document which listeners react to each event
Where it goes wrong
Avoid:
- Events for simple direct calls
- Listeners with hidden dependencies on each other
- Unlogged event chains
- Critical paths that depend on event ordering
The numbers behind it
| Measure | Figure |
|---|---|
| Events and listeners | publishers do not know who reacts |
| Queued listeners | move work out of the request cycle |
| Ordering | event handling order is not always guaranteed |
| Debugging | distributed side effects are harder to trace |
Getting outside help
When to hand it over: Bring in help when side effects become hard to trace.
Where this comes from
- Laravel Documentation — Events
- Microsoft Learn — Event-driven architecture style
The figures and practices above come from the sources listed.
Working on something like this?
We take on Web Design & Development work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.
Where to go next
Spotted something wrong? Report an error on this page. We correct on the page and say what changed.