11. Sometimes it’s not just create a service
Checkout
Shop checkout page
Order management
- Purchase Order
- Order Acceptance
- Order Processing
- Stock availability
- Sales Return
17. Introduction of Event-Driven Architecture (EDA)
Also known as message-driven architecture, is a software architecture pattern
promoting the production, detection, consumption of, and reaction to events
An event can be defined as "a significant change in state"
K. Mani Chandy Event-Driven Applications
We make a change to the state of a system, we record that state
change as an event, and we can confidently rebuild the system
state by reprocessing the events at any time in the future...
Martin Fowler
26. EDA - Event reactions
- Product flow example
BackOffice Catalog+POST
+PUT
+PATCH
+DELETE
Product
Search
Product
+POST
+PUT
+PATCH
+DELETE
Feed
Product
+POST
+PUT
+PATCH
+DELETE
MarketPlace+POST
+PUT
+PATCH
+DELETE
Product
Catalog must know all services, e-commerce flow, it
isn't agnostic
A lot of point to point integration
35. EDA - Event reactions
EDA approach
BackOffice Catalog+POST
+PUT
+PATCH
+DELETE
Product
Search
Feed
MarketPlace
Central Message Bus
Product Created
Product Updated
Product Deleted
36. EDA - Event reactions
EDA approach
BackOffice Catalog+POST
+PUT
+PATCH
+DELETE
Product
Search
Feed
MarketPlace
Central Message Bus
Product Created
Product Updated
Product Deleted
Events
37. EDA - Event reactions
EDA approach
BackOffice Catalog+POST
+PUT
+PATCH
+DELETE
Product
Search
Feed
MarketPlace
Central Message Bus
Product Created
Product Updated
Product Deleted
Central Message Handler
38. EDA - Event reactions
EDA approach
BackOffice Catalog+POST
+PUT
+PATCH
+DELETE
Product
Search
Feed
MarketPlace
Central Message Bus
Product Created
Product Updated
Product Deleted
Central Message Handler
39. EDA - Event reactions
EDA approach
BackOffice Catalog
+POST
+PUT
+PATCH
+DELETE
Search
Feed
MarketPlace
Central Message Bus
Central Message Handler
MarketPlace Product Created
40. EDA - Event reactions
EDA approach
BackOffice Catalog
+POST
+PUT
+PATCH
+DELETE
Search
Feed
MarketPlace
Central Message Bus
Central Message Handler
MarketPlace Product Created
41. The benefits
- If error raises on service, the message remains in queue
- It will be picked up later
- Services don’t need to know about how to make updates to other
services
- Adding more services is easy
- Scales well
42. References
- Event Driven Architecture - K. Mani Chandy
- What do you mean by “Event-Driven”? - Martin Fowler
- Programming Without a Call Stack - Gregor Hohpe
- Event Driven Architecture – The Basics - John Mathon