Building Event Driven Systems
-
Upload
wso2-inc -
Category
Technology
-
view
438 -
download
0
Transcript of Building Event Driven Systems
![Page 1: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/1.jpg)
Building Event Driven Systems
Shiroshica KulatilakeSolutions Architect
![Page 2: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/2.jpg)
Setting Expectations
o Today’s Enterprise Systems and how events fit in
o What is Event Driven Architecture
o Patterns for building Event Driven Systems
o Summarize
Image: thinkpublic/photopin cc
![Page 3: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/3.jpg)
Enterprise Systems & Events
![Page 4: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/4.jpg)
Enterprises Today
o Distributed- Functionality is broken down into several sub systems - Located in multiple places
o Ubiquitous - Based on parties interacting through different means
o Connected- Built based on synergies- Own as well as partner systems need to interact with each
other efficiently
Image: thinkpublic/photopin cc
![Page 5: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/5.jpg)
Events in Enterprise Systems
o Occurrence within the context of interest o A series of events depicting one event in the real world
- e.g. A customer placing an order in a retail systemo Not all events are of interest o Most everyday events can be dealt in an asynchronous manner o Occurrence of an situation (relevant event) requires something to
react to it - to move from one state to another o For this events should be detected, situations filtered and
processes notifiedo Leads to Event Driven Architecture
![Page 6: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/6.jpg)
Event Driven Architecture
![Page 7: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/7.jpg)
Evolutiono SOA
- Synchronous request response systems with asynchronous message delivery
- Technically loosely coupled - Functionally tightly coupled - Mostly centralized
o Evolving into EDA- Based on message driven model for information propagation- Spatial and temporal decoupling- Analogous to the operational model of an organisation where a
series of events take place
o Suited where- Distributed environments - Higher level of autonomy is needed at unit level
Image: thinkpublic/photopin cc
![Page 8: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/8.jpg)
Main Components
o Event - significant happening which results in change of state from a business perspective
o Event generator- publishes eventso Event processor- consumes events and decide what to doo Event channel - medium where event lies before consumption
![Page 9: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/9.jpg)
Principles
o Immediate information dissemination and reactive business process execution
o Fire and forget - push based mechanismo Single responsibility at practiceo Autonomous messages for the receiver to processo Higher decoupling - no need to bind to contractso Logical decoupling of functional units - not dependent and less
impact from change o Receiver driven flow control - more responsibility lies with receivers o Near real time information consistency
![Page 10: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/10.jpg)
Advantages
o Effective data integrationo Low latency of information o High reactivenesso More accurate responseso High flexibility o Higher business agility
![Page 11: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/11.jpg)
Generic EDA Pattern
![Page 12: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/12.jpg)
Event Mediator Pattern
http://radar.oreilly.com/2015/02/variations-in-event-driven-architecture.html
![Page 13: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/13.jpg)
Event Mediator Pattern
o Need to orchestrate multiple steps
o Orchestration happens through a central mediator
o Multiple steps need to happen in a certain order
o Processing will be done by separate entities which need to be invoked in many ways
o Fits scenarios which are complex, have some sort of orchestration logic and approval tasks etc as well
Image: thinkpublic/photopin cc
![Page 14: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/14.jpg)
Broker Pattern
http://radar.oreilly.com/2015/02/variations-in-event-driven-architecture.html
![Page 15: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/15.jpg)
Broker Pattern
o Message flow is distributed across several processors with no orchestration
o Fits for use cases where the flow is entirely dependent on event receiving with no timing
o Once a processor is done with processing another event will be fired to the broker which will be consumed by another processor
Image: thinkpublic/photopin cc
![Page 16: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/16.jpg)
Components in an Event Driven System
o Process Engine
o Mediation Engine
o Message Broker
o Business Activity Monitor
o Complex Event Processor
o Business Rules Manager
Image: thinkpublic/photopin cc
![Page 17: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/17.jpg)
Patterns in building Event Driven Systems
![Page 18: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/18.jpg)
Centralized Message Driven System
![Page 19: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/19.jpg)
Sample Solution
![Page 20: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/20.jpg)
Sample Extended Solution
![Page 21: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/21.jpg)
Autonomous Message Driven System
![Page 22: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/22.jpg)
Sample Solution
![Page 23: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/23.jpg)
Sample Extended Solution
![Page 24: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/24.jpg)
Request Rate Controlling
![Page 25: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/25.jpg)
Guaranteed Delivery - Directly via Broker
![Page 26: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/26.jpg)
Guaranteed Delivery - via Mediation Engine
![Page 27: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/27.jpg)
Guaranteed Delivery - Fault Handling
![Page 28: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/28.jpg)
Monitoring and Alerting
![Page 29: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/29.jpg)
Keeping up with the trends
![Page 30: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/30.jpg)
Internet of Things (IoT)
Image: thinkpublic/photopin cc
![Page 31: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/31.jpg)
Internet of Things (IoT)
o There exists a plethora of devices which provide data in several contexts
o This data needs to be captured in order to analyze and derive intelligence and then take actions
o Point to point integration with each device is not a possibility
o Leads to the use of Event Driven Architecture through the use of protocols which work on publish-subscribe mechanisms - e.g. MQTT and also through handling large scale event analyzing
Image: thinkpublic/photopin cc
![Page 32: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/32.jpg)
Internet of Things (IoT)
Image: thinkpublic/photopin cc
![Page 33: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/33.jpg)
Microservices Architecture
Image: thinkpublic/photopin cc
![Page 34: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/34.jpg)
Microservices Architecture
o Microservices promote distributed data management
o Data in microservices - Are private to a specific microservice - Use polygot persistence - Might not expose generic APIs for all possible modes of use
o However, business transactions span multiple microservices which would need accessing private data of other microservices
o Leads to the use of Event Driven Architecture where distributed data management is handled through the use of events
o Variants are event tables, transaction log mining and event sourcing which try to reduce errors relating to atomicity
Image: thinkpublic/photopin cc
![Page 35: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/35.jpg)
Microservices Architecture
Image: thinkpublic/photopin cc
![Page 36: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/36.jpg)
Reactive Architecture
Image: thinkpublic/photopin cc
![Page 37: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/37.jpg)
Reactive Architecture
o To achieve being reactive, systems should be designed with containment of functionality in mind so that scaling, isolation of failures and adaptable fault tolerance happens
o Microservices Architecture can achieve this
o Also, for a system to be reactive it should be able to- React to Load through scalability- React to failure through recoverability- React to user experience effectively
o The ability to react to events and act accordingly becomes the main ingredient
o Leads to designing and building systems in an Event Driven manner
Image: thinkpublic/photopin cc
![Page 38: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/38.jpg)
Key take aways ...
![Page 39: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/39.jpg)
Building Event Driven Systems
o What does your enterprise system look like ?- Determine how complex or simple your system flows are- Determine how autonomous your processing units are- Determine how isolated your processing units should be
o What do you need to do with event processing ? - Identify both functional as well as operational needs
o Which pattern would suit you best ?- Select based on enterprise system characteristics and needs
o Which components do you need ?- Identity which middleware components you need to achieve the
above
Image: thinkpublic/photopin cc
![Page 40: Building Event Driven Systems](https://reader031.fdocuments.in/reader031/viewer/2022022411/58eccb401a28ab293c8b45af/html5/thumbnails/40.jpg)
Referenceso Event Processing in Action - Opher Etzion and Peter Niblett -
Manning
o https://msdn.microsoft.com/en-us/library/dd129913.aspx
o Software Architecture Patterns - Mark Richards - Orielly
o http://radar.oreilly.com/2015/02/variations-in-event-driven-architecture.html
o http://wso2.com/whitepapers/a-reference-architecture-for-the-internet-of-things/
o https://www.nginx.com/blog/event-driven-data-management-microservices/
Image: thinkpublic/photopin cc