Event-First Architectural Pattern
In an event-driven architecture, the emitter of an event is decoupled from the processors that consume it, making the event itself the API. This decoupling enables consuming apps to evolve without requiring changes in the emitter. Consider the analogy of entering a room and the light turning on to react to an event. This contrasts with a command-based approach where the light switch is flipped to command the light to turn on.
Instead of a single shared data store, an architecture with specific, targeted views is preferable. Consumers can store relevant data from events, often only requiring precise information. The true strength of the event-first process becomes evident when enhancing the system. In the command-based analog, knowing how to act lies with the person issuing the command. In the event-command pattern, the service is aware of the endpoints and APIs of other services and makes the necessary calls. This will increase the coupling between consumers and producers of events, making the system harder to reason and evolve.