Gaurav
S
alvi
Event Driven Architecture (EDA) - Short Notes
Why it was created ?
Most modern digital platforms are microservice and cloud computing based. This leads to need for communication between microservices which is most commonly is http based. HTTP based communication is blocking and synchronous and leads to several problems like :
- tight coupling which result into to errors during unavailability of another service.
- connection time-outs because another service is busy
- less scalable due to blocked client requests.
EDA solves all of these core problem of micro-service architecture.
What is it ?
EDA is system design approach where individual components act as producers and consumers of events which are meaningful to business.
How it works ?
A typical EDA consists of following core components
- Events : events represent change in state of business domain like user-signed-in, user-placed-ordered
- Event Producers : These are services which produce certain events
- Event Consumers : These are services which are interested in particular events and consume them
- Message Broker : This is infrastructure solution to receive, pass on and queue events in form of messages.
Pros & Cons
Pros
- Loose Coupling leads to increased service independence, resilience, throughput, timed-scaling
- Unavailability of service doesn’t impact
- Auto scaling
- Serverless architecture
Cons
- In-consistency
- duplicate events
- missed events
- out of sequence events
- Dependency on message broker.
When to use it ?
- In microservice architecture
When not use it ?
- Result is desired immediately
How can I use it ?
For any comments feel free to contact on: grsalvi@gmail.com
Share