Event Driven Architecture Flashcards
1
Q
Event Driven Architecture (EDA)
A
Services asynchronously publish events that are consumed by other interested services.
- Each service has it’s own event bus/queue and manages it’s own state which is persisted
- Each services annotates events specific to it’s own needs by either adding/removing fields from the event when it is persisted.
- Each service can retains & persist information in the event that was given it by the sending service.
https://www.youtube.com/watch?v=rJHTK2TfZ1I
2
Q
Advantages of Event Driven Architecture
A
- Very helpful when you need to evaluate parallel events in time (gaming headshot).
- Persisted event state makes it easy to recover event history as well as replace services by simply replaying the events into the new service.
- Having event data from the sending service means it does not need to re-request the event from the sending service.
- Highly available due to advantage 2
- it provides a transactional guarantee, at least 1 and at most 1 (can retry sending events if a service doesn’t receive it).
3
Q
Disadvantages of Event Driven Architecture
A
- Data consistency due to changes in state from sending service after events have been sent to receiving services.
- Can’t replace edge services that are dependant on external services because you can’t guarantee that services state by replaying the events even when storing timestamps.
- Less control than request response particularly with regard to timing, event priority and the service that the events go to (i.e. you may not want to send an event to a particular service for security reasons).
- Only 3 ways to get to specific event in the history (1 replay from start, 2 diff based, 2 undo events) this is not always ideal.
- Difficult to understand the flow of the system past 1 service.
- Difficult to change or migrate away from to anything that doesn’t understand events (i.e. request response services).
4
Q
What are examples of technology that uses event driven architecture?
A
Git, React, Node.js
5
Q
A