Essay about event driven architecture
-
Upload
paulo-victor-gomes -
Category
Technology
-
view
91 -
download
6
Transcript of Essay about event driven architecture
![Page 1: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/1.jpg)
Essay about Event-Driven Architecture
Paulo Victor Gomes @pvgomesTwitter @Pv_fusion
CTO at Natue - www.natue.com.brVoucher: PHPEXPERIENCE2017
![Page 2: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/2.jpg)
Case - E-CommerceIn this essay we will use the e-commerce as an example
Shop- Customer- Catalog- Cart- Checkout- CMS- WMS- Freight….
![Page 3: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/3.jpg)
Monolithic
Customer
Catalog
Cart
Checkout
Shop
Customer
CartCatalog
Catalog
Cart
CMS
CMS
Url manager / SEO
Checkout
Newsletter
Newsletter
Newsletter
Freight
Freight
Freight
FreightWMS
![Page 4: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/4.jpg)
Monolithic
Customer
Catalog
Cart
Checkout
Shop
Customer
CartCatalog
Catalog
Cart
CMS
CMS
Url manager / SEO
Checkout
Newsletter
Newsletter
Newsletter
Freight
Freight
Freight
FreightWMS
This does not scale very well
It is very difficult to make changes
![Page 5: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/5.jpg)
Service Oriented Architecture (SOA) is the solutionWe can divide the problem domain into separate systems
![Page 6: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/6.jpg)
Beginning SOA’s approach
Customer
Catalog
Cart
Checkout
Shop
Customer
CartCatalog
Catalog
Cart
CMS
CMS
Url manager / SEO
Checkout
Newsletter
Freight
Freight
Freight
Freight
WMS
![Page 7: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/7.jpg)
Beginning SOA’s approach
Customer
Catalog
Cart
Checkout
Shop
Customer
CartCatalog
Catalog
Cart
CMS
CMS
Url manager / SEO
Checkout
Newsletter
Freight
Freight
Freight
Freight
WMS
![Page 8: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/8.jpg)
Keep moving forward SOA’s approach...
Customer
Catalog
Cart
Checkout
Shop
Customer
CartCatalog
Catalog
Cart
CMS
Url manager / SEO
Checkout
Newsletter
Freight
Freight
WMS
![Page 9: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/9.jpg)
Keep moving forward SOA’s approach...
Catalog
Cart
Checkout
Shop
Customer
CartCatalog
Catalog
Cart
CMS
Url manager / SEO
Checkout
Newsletter
Freight
WMS
![Page 10: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/10.jpg)
Keep moving forward SOA’s approach...
Catalog
Cart
Shop
Customer
CartCatalog
Catalog
Cart
CMS
Url manager / SEO
Checkout
Newsletter
Freight
WMS
![Page 11: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/11.jpg)
Sometimes it’s not just create a service
Checkout
Shop checkout page Order management- Purchase Order- Order Acceptance- Order Processing- Stock availability- Sales Return
![Page 12: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/12.jpg)
Keep moving forward SOA’s approach...
Catalog
Cart
Shop
Customer
CartCatalog
Catalog
Cart
CMS
Url manager / SEO
Checkout
Newsletter
Freight
WMS
Checkout-SPAOrder
Management
![Page 13: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/13.jpg)
Keep moving forward SOA’s approach...Catalog
CartShop
Customer
Cart
Cart
CMS
Url manager / SEO
Checkout
Newsletter
Freight
WMS
Checkout-SPAOrder
Management
Search API
![Page 14: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/14.jpg)
Bye Bye Monolithic
Catalog
Shop
Customer
Cart
CMS
Url manager / SEO
Newsletter
Freight
WMS
Checkout-SPAOrder
ManagementSearch
APIStock API
![Page 15: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/15.jpg)
Bye Bye Monolithic
Catalog
Shop
Customer
Cart
CMS
Url manager / SEO
Newsletter
Freight
WMS
Checkout-SPAOrder
ManagementSearch
APIStock API
![Page 16: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/16.jpg)
Bye Bye Monolithic
Catalog
Shop
Customer
Cart
CMS
Url manager / SEO
Newsletter
Freight
WMS
Checkout-SPAOrder
ManagementSearch
APIStock API
A lot of point to point integration
![Page 17: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/17.jpg)
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
![Page 18: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/18.jpg)
Events
![Page 19: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/19.jpg)
EDA Main Goal
EDA is not just about agnostic services, is more about reacting through the Events
![Page 20: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/20.jpg)
EDA - Event reactionsProduct flow example
![Page 21: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/21.jpg)
BackOffice
EDA - Event reactionsProduct flow example
![Page 22: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/22.jpg)
BackOffice Catalog+POST+PUT+PATCH+DELETE
Product
EDA - Event reactionsProduct flow example
![Page 23: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/23.jpg)
BackOffice Catalog+POST+PUT+PATCH+DELETE
Product SearchProduct+POST+PUT+PATCH+DELETE
EDA - Event reactionsProduct flow example
![Page 24: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/24.jpg)
BackOffice Catalog+POST+PUT+PATCH+DELETE
Product SearchProduct+POST+PUT+PATCH+DELETE
FeedProduct+POST+PUT+PATCH+DELETE
EDA - Event reactionsProduct flow example
![Page 25: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/25.jpg)
EDA - Event reactionsProduct flow example
BackOffice Catalog+POST+PUT+PATCH+DELETE
Product SearchProduct+POST+PUT+PATCH+DELETE
FeedProduct+POST+PUT+PATCH+DELETE
MarketPlace+POST+PUT+PATCH+DELETE
Product
![Page 26: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/26.jpg)
EDA - Event reactions
- Product flow example
BackOffice Catalog+POST+PUT+PATCH+DELETE
Product SearchProduct+POST+PUT+PATCH+DELETE
FeedProduct+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
![Page 27: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/27.jpg)
EDA - Event reactions
- Product flow example
BackOffice Catalog+POST+PUT+PATCH+DELETE
Product SearchProduct+POST+PUT+PATCH+DELETE
FeedProduct+POST+PUT+PATCH+DELETE
MarketPlace+POST+PUT+PATCH+DELETE
Product
Let's try another approach
![Page 28: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/28.jpg)
EDA - Event reactionsAnother approach
BackOffice Catalog+POST+PUT+PATCH+DELETE
Product SearchProduct
Feed
MarketPlace+GETProduct
+GET
+GETProduct
![Page 29: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/29.jpg)
EDA - Event reactionsAnother approach
BackOffice Catalog+POST+PUT+PATCH+DELETE
Product SearchProduct
Feed
MarketPlace+GETProduct
+GET
+GETProduct
![Page 30: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/30.jpg)
EDA - Event reactions
- Product flow example
BackOffice Catalog+POST+PUT+PATCH+DELETE
Product SearchProduct+POST+PUT+PATCH+DELETE
FeedProduct+POST+PUT+PATCH+DELETE
MarketPlace+POST+PUT+PATCH+DELETE
Product
![Page 31: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/31.jpg)
EDA - Event reactions
- Product flow example
BackOffice Catalog+POST+PUT+PATCH+DELETE
Product SearchProduct+POST+PUT+PATCH+DELETE
FeedProduct+POST+PUT+PATCH+DELETE
MarketPlace+POST+PUT+PATCH+DELETE
ProductWhen will our services call Catalog?
![Page 32: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/32.jpg)
EDA - Event reactionsAnother approach
BackOffice Catalog+POST+PUT+PATCH+DELETE
Product SearchProduct
Feed
MarketPlace+GETProduct
+GET
+GETProduct
![Page 33: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/33.jpg)
EDA - Event reactions
- Product flow example
BackOffice Catalog+POST+PUT+PATCH+DELETE
Product SearchProduct+POST+PUT+PATCH+DELETE
FeedProduct+POST+PUT+PATCH+DELETE
MarketPlace+POST+PUT+PATCH+DELETE
ProductPerhaps a cronjob?
![Page 34: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/34.jpg)
EDA - Event reactionsEDA approach
BackOffice Catalog+POST+PUT+PATCH+DELETE
Product Search
Feed
MarketPlace
?
![Page 35: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/35.jpg)
EDA - Event reactionsEDA approach
BackOffice Catalog+POST+PUT+PATCH+DELETE
Product Search
Feed
MarketPlaceCentral Message Bus
Product CreatedProduct UpdatedProduct Deleted
![Page 36: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/36.jpg)
EDA - Event reactionsEDA approach
BackOffice Catalog+POST+PUT+PATCH+DELETE
Product Search
Feed
MarketPlaceCentral Message Bus
Product CreatedProduct UpdatedProduct Deleted
Events
![Page 37: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/37.jpg)
EDA - Event reactionsEDA approach
BackOffice Catalog+POST+PUT+PATCH+DELETE
Product Search
Feed
MarketPlaceCentral Message Bus
Product CreatedProduct UpdatedProduct Deleted
Central Message Handler
![Page 38: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/38.jpg)
EDA - Event reactionsEDA approach
BackOffice Catalog+POST+PUT+PATCH+DELETE
Product Search
Feed
MarketPlaceCentral Message Bus
Product CreatedProduct UpdatedProduct Deleted
Central Message Handler
![Page 39: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/39.jpg)
EDA - Event reactionsEDA approach
BackOffice Catalog
+POST+PUT+PATCH+DELETE
Search
Feed
MarketPlaceCentral Message Bus
Central Message HandlerMarketPlace Product Created
![Page 40: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/40.jpg)
EDA - Event reactionsEDA approach
BackOffice Catalog
+POST+PUT+PATCH+DELETE
Search
Feed
MarketPlaceCentral Message Bus
Central Message HandlerMarketPlace Product Created
![Page 41: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/41.jpg)
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
![Page 42: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/42.jpg)
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
![Page 43: Essay about event driven architecture](https://reader034.fdocuments.us/reader034/viewer/2022042611/58eb8d851a28abde148b46cd/html5/thumbnails/43.jpg)
Thank youTwitter @Pv_Fusion
Slack @pvgomes
Github github.com/pvgomes
https://joind.in/talk/0525a