Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Essay about Event-Driven
Architecture
Paulo Victor Gomes @pvgomes
Twitter @Pv_fusion
CTO at Natue - www.natue.com.br
Vouch...
Case - E-Commerce
In this essay we will use the e-commerce as an example
Shop
- Customer
- Catalog
- Cart
- Checkout
- CMS...
Monolithic
Customer
Catalog
Cart
Checkout
Shop
Customer
CartCatalog
Catalog
Cart
CMS
CMS
Url
manager / SEO
Checkout
Newsle...
Monolithic
Customer
Catalog
Cart
Checkout
Shop
Customer
CartCatalog
Catalog
Cart
CMS
CMS
Url
manager / SEO
Checkout
Newsle...
Service Oriented Architecture (SOA) is the solution
We can divide the problem domain into separate systems
Beginning SOA’s approach
Customer
Catalog
Cart
Checkout
Shop
Customer
CartCatalog
Catalog
Cart
CMS
CMS
Url
manager / SEO
C...
Beginning SOA’s approach
Customer
Catalog
Cart
Checkout
Shop
Customer
CartCatalog
Catalog
Cart
CMS
CMS
Url
manager / SEO
C...
Keep moving forward SOA’s approach...
Customer
Catalog
Cart
Checkout
Shop
Customer
CartCatalog
Catalog
Cart
CMS
Url
manage...
Keep moving forward SOA’s approach...
Catalog
Cart
Checkout
Shop
Customer
CartCatalog
Catalog
Cart
CMS
Url
manager / SEO
C...
Keep moving forward SOA’s approach...
Catalog
Cart
Shop
Customer
CartCatalog
Catalog
Cart
CMS
Url
manager / SEO
Checkout
N...
Sometimes it’s not just create a service
Checkout
Shop checkout page
Order management
- Purchase Order
- Order Acceptance
...
Keep moving forward SOA’s approach...
Catalog
Cart
Shop
Customer
CartCatalog
Catalog
Cart
CMS
Url
manager / SEO
Checkout
N...
Keep moving forward SOA’s approach...
Catalog
Cart
Shop
Customer
Cart
Cart
CMS
Url
manager / SEO
Checkout
Newsletter
Freig...
Bye Bye Monolithic
Catalog
Shop
Customer
Cart
CMS
Url
manager / SEO
Newsletter
Freight
WMS
Checkout-SPA
Order
Management
S...
Bye Bye Monolithic
Catalog
Shop
Customer
Cart
CMS
Url
manager / SEO
Newsletter
Freight
WMS
Checkout-SPA
Order
Management
S...
Bye Bye Monolithic
Catalog
Shop
Customer
Cart
CMS
Url
manager / SEO
Newsletter
Freight
WMS
Checkout-SPA
Order
Management
S...
Introduction of Event-Driven Architecture (EDA)
Also known as message-driven architecture, is a software architecture patt...
Events
EDA Main Goal
EDA is not just about agnostic
services, is more about reacting
through the Events
EDA - Event reactions
Product flow example
BackOffice
EDA - Event reactions
Product flow example
BackOffice Catalog+POST
+PUT
+PATCH
+DELETE
Product
EDA - Event reactions
Product flow example
BackOffice Catalog+POST
+PUT
+PATCH
+DELETE
Product
Search
Product
+POST
+PUT
+PATCH
+DELETE
EDA - Event reactions
Product...
BackOffice Catalog+POST
+PUT
+PATCH
+DELETE
Product
Search
Product
+POST
+PUT
+PATCH
+DELETE
Feed
Product
+POST
+PUT
+PATC...
EDA - Event reactions
Product flow example
BackOffice Catalog+POST
+PUT
+PATCH
+DELETE
Product
Search
Product
+POST
+PUT
+...
EDA - Event reactions
- Product flow example
BackOffice Catalog+POST
+PUT
+PATCH
+DELETE
Product
Search
Product
+POST
+PUT...
EDA - Event reactions
- Product flow example
BackOffice Catalog+POST
+PUT
+PATCH
+DELETE
Product
Search
Product
+POST
+PUT...
EDA - Event reactions
Another approach
BackOffice Catalog+POST
+PUT
+PATCH
+DELETE
Product
Search
Product
Feed
MarketPlace...
EDA - Event reactions
Another approach
BackOffice Catalog+POST
+PUT
+PATCH
+DELETE
Product
Search
Product
Feed
MarketPlace...
EDA - Event reactions
- Product flow example
BackOffice Catalog+POST
+PUT
+PATCH
+DELETE
Product
Search
Product
+POST
+PUT...
EDA - Event reactions
- Product flow example
BackOffice Catalog+POST
+PUT
+PATCH
+DELETE
Product
Search
Product
+POST
+PUT...
EDA - Event reactions
Another approach
BackOffice Catalog+POST
+PUT
+PATCH
+DELETE
Product
Search
Product
Feed
MarketPlace...
EDA - Event reactions
- Product flow example
BackOffice Catalog+POST
+PUT
+PATCH
+DELETE
Product
Search
Product
+POST
+PUT...
EDA - Event reactions
EDA approach
BackOffice Catalog+POST
+PUT
+PATCH
+DELETE
Product
Search
Feed
MarketPlace
?
EDA - Event reactions
EDA approach
BackOffice Catalog+POST
+PUT
+PATCH
+DELETE
Product
Search
Feed
MarketPlace
Central Mes...
EDA - Event reactions
EDA approach
BackOffice Catalog+POST
+PUT
+PATCH
+DELETE
Product
Search
Feed
MarketPlace
Central Mes...
EDA - Event reactions
EDA approach
BackOffice Catalog+POST
+PUT
+PATCH
+DELETE
Product
Search
Feed
MarketPlace
Central Mes...
EDA - Event reactions
EDA approach
BackOffice Catalog+POST
+PUT
+PATCH
+DELETE
Product
Search
Feed
MarketPlace
Central Mes...
EDA - Event reactions
EDA approach
BackOffice Catalog
+POST
+PUT
+PATCH
+DELETE
Search
Feed
MarketPlace
Central Message Bu...
EDA - Event reactions
EDA approach
BackOffice Catalog
+POST
+PUT
+PATCH
+DELETE
Search
Feed
MarketPlace
Central Message Bu...
The benefits
- If error raises on service, the message remains in queue
- It will be picked up later
- Services don’t need...
References
- Event Driven Architecture - K. Mani Chandy
- What do you mean by “Event-Driven”? - Martin Fowler
- Programmin...
Thank you
Twitter @Pv_Fusion
Slack @pvgomes
Github github.com/pvgomes
pv.gomes89@gmail.com
https://joind.in/talk/0525a
Upcoming SlideShare
Loading in …5
×

Essay about event driven architecture

501 views

Published on

Essay about event driven architecture php experience 2017

Published in: Technology
  • Be the first to comment

Essay about event driven architecture

  1. 1. Essay about Event-Driven Architecture Paulo Victor Gomes @pvgomes Twitter @Pv_fusion CTO at Natue - www.natue.com.br Voucher: PHPEXPERIENCE2017
  2. 2. Case - E-Commerce In this essay we will use the e-commerce as an example Shop - Customer - Catalog - Cart - Checkout - CMS - WMS - Freight….
  3. 3. Monolithic Customer Catalog Cart Checkout Shop Customer CartCatalog Catalog Cart CMS CMS Url manager / SEO Checkout Newsletter Newsletter Newsletter Freight Freight Freight FreightWMS
  4. 4. 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
  5. 5. Service Oriented Architecture (SOA) is the solution We can divide the problem domain into separate systems
  6. 6. 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
  7. 7. 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
  8. 8. Keep moving forward SOA’s approach... Customer Catalog Cart Checkout Shop Customer CartCatalog Catalog Cart CMS Url manager / SEO Checkout Newsletter Freight Freight WMS
  9. 9. Keep moving forward SOA’s approach... Catalog Cart Checkout Shop Customer CartCatalog Catalog Cart CMS Url manager / SEO Checkout Newsletter Freight WMS
  10. 10. Keep moving forward SOA’s approach... Catalog Cart Shop Customer CartCatalog Catalog Cart CMS Url manager / SEO Checkout Newsletter Freight WMS
  11. 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
  12. 12. Keep moving forward SOA’s approach... Catalog Cart Shop Customer CartCatalog Catalog Cart CMS Url manager / SEO Checkout Newsletter Freight WMS Checkout-SPA Order Management
  13. 13. Keep moving forward SOA’s approach... Catalog Cart Shop Customer Cart Cart CMS Url manager / SEO Checkout Newsletter Freight WMS Checkout-SPA Order Management Search API
  14. 14. Bye Bye Monolithic Catalog Shop Customer Cart CMS Url manager / SEO Newsletter Freight WMS Checkout-SPA Order Management Search API Stock API
  15. 15. Bye Bye Monolithic Catalog Shop Customer Cart CMS Url manager / SEO Newsletter Freight WMS Checkout-SPA Order Management Search API Stock API
  16. 16. Bye Bye Monolithic Catalog Shop Customer Cart CMS Url manager / SEO Newsletter Freight WMS Checkout-SPA Order Management Search API Stock API A lot of point to point integration
  17. 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
  18. 18. Events
  19. 19. EDA Main Goal EDA is not just about agnostic services, is more about reacting through the Events
  20. 20. EDA - Event reactions Product flow example
  21. 21. BackOffice EDA - Event reactions Product flow example
  22. 22. BackOffice Catalog+POST +PUT +PATCH +DELETE Product EDA - Event reactions Product flow example
  23. 23. BackOffice Catalog+POST +PUT +PATCH +DELETE Product Search Product +POST +PUT +PATCH +DELETE EDA - Event reactions Product flow example
  24. 24. BackOffice Catalog+POST +PUT +PATCH +DELETE Product Search Product +POST +PUT +PATCH +DELETE Feed Product +POST +PUT +PATCH +DELETE EDA - Event reactions Product flow example
  25. 25. 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
  26. 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
  27. 27. 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 Let's try another approach
  28. 28. EDA - Event reactions Another approach BackOffice Catalog+POST +PUT +PATCH +DELETE Product Search Product Feed MarketPlace+GET Product +GET +GET Product
  29. 29. EDA - Event reactions Another approach BackOffice Catalog+POST +PUT +PATCH +DELETE Product Search Product Feed MarketPlace+GET Product +GET +GET Product
  30. 30. 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
  31. 31. 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 When will our services call Catalog?
  32. 32. EDA - Event reactions Another approach BackOffice Catalog+POST +PUT +PATCH +DELETE Product Search Product Feed MarketPlace+GET Product +GET +GET Product
  33. 33. 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 Perhaps a cronjob?
  34. 34. EDA - Event reactions EDA approach BackOffice Catalog+POST +PUT +PATCH +DELETE Product Search Feed MarketPlace ?
  35. 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. 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. 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. 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. 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. 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. 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. 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
  43. 43. Thank you Twitter @Pv_Fusion Slack @pvgomes Github github.com/pvgomes pv.gomes89@gmail.com https://joind.in/talk/0525a

×