techdays 2010 portugal - event driven architectures - 16x9
Post on 08-Dec-2014
2.174 Views
Preview:
DESCRIPTION
TRANSCRIPT
Event-Driven Architecture Como, Quando e Porquê?
ARC316
Nuno GodinhoPartner & CTO @ ITech4Allnuno.godinho@itech4all.com
@NunoGodinho
Nuno Filipe GodinhoPartner & CTO @ ITech4all
Mail: Nuno.Godinho@itech4all.comNuno.Godinho@sapo.pt
Blogs: http://pontonetpt.com/blogs/nunogodinhohttp://xamlpt.com/blogs/nunogodinhohttp://weblogs.asp.net/nunogodinhohttp://msmvps.org/blogs/nunogodinho
Twitter: @NunoGodinho
About Me
• Introduction• Event Driven Architecture• SOA vs EDA• How to Implement• Resources• Q&A
Agenda
Introduction
• SOA is a synchronous RPC (mostly over Web services)
• EDA is SOA
• The best of EDA and SOA is combined in SOA 2.0
IntroductionCommon Thoughts about SOA and EDA
• Moving towards on-Demand Business. Why?• Organizations tend to change their structure frequently
• Parts of the business process are outsourced to External Partners
• Departments and business units are seen now as service providers
• Focus not only internally on the organization, but they are seeking for external markets to offer their services
IntroductionTrend Change
• Moving towards on-Demand Business. Why?• Everything is moving toward on-demand
business where service providers react to impulses from the environment.
• Loose coupling between application components
IntroductionTrend Change
• Linking application to simplify and automate a process, while avoiding changes to existing applications
IntroductionSample Painpoint : EAI – Enterprise Application Integration
• File Tranfer• Import and Export Files
• Common Issues:• Various Formats • Needs Translation• Manually Loaded
IntroductionHow to Solve this painpoint?
• Shared Databases• Making integration on the Database
Level• Several Applications share the same
Database
• Common Issues:• Data is tightly coupled to multiple
applications• Incremental or partial updates are
impossible
IntroductionHow to Solve this painpoint?
• Web Services• Providing Services to
automate the integration
• Common Issues:• Requires services to be
available at invocation• Results in multiple call
stacks• Resource consuming
• Yet another Remote Procedure Call (RPC, COM, Corba, DCOM, ...)
IntroductionHow to Solve this painpoint?
• Messaging• Using Messaging
mechanisms
• Basics:• Defined data format• Asynchronous
Operations• Minimized Coupling• Fault Tolerance• Data Freshness
IntroductionHow to Solve this painpoint?
• Messaging• Defined data format
• Contract between Producer and Consumer• Internal formats remain private• Integration is maintained at the edge of the
application, to prevent internal changes to impact the interface
IntroductionHow to Solve this painpoint?
• Messaging• Asynchronous Operations
• Processes run on their own context• Source process continues• No need for the service to be always
available
IntroductionHow to Solve this painpoint?
• Messaging• Minimized Coupling
• Additive Model reducing the changes needed to existing systems
• Reduces dependencies• Increases service reuse• Enable Isolated Service Testing
IntroductionHow to Solve this painpoint?
• Messaging• Fault Tolerance
• Durable Messaging
• Improved recoverability
• Compensating Actions to handle partial failures
IntroductionHow to Solve this painpoint?
• Messaging• Data Freshness
• Favors small data transfer• Minimized data exchange latency
IntroductionHow to Solve this painpoint?
• Events• Represent a change in state• Self-Contained
• Pure and complete representation of an Event
• No references to other data sources• Reduces dependencies, Loosens coupling
• Uniquely indentified• Enabled idempotent handling events• Improves tracebility of related processing• Allows correlation with related events
IntroductionHow to Solve this painpoint?
• Events• Time relevant, not time sensitive• Sourced using messaging• Observable
• Published events can be observed by multiple subscribers
• Event stream Processing
IntroductionHow to Solve this painpoint?
• Event Types• Execution• Lifecycle• Management• Business
IntroductionHow to Solve this painpoint?
Event Driven Architecture
• Architecture pattern that orchestrates behavior around:• Production• Detection • Consumption of events as well as the responses they
invoke.
• A method for building enterprise systems in which events flow between decoupled components and services
• A maintainable, sustainable and extensible model for building complex, distributed applications
Event Driven ArchitectureWhat is EDA?
• Suited for Asynchronous, unpredictable environments
• Extremely Loosely Coupled
• Inversion of communication
Event Driven ArchitectureWhat is EDA?
• Companies must manage and react to a large number events every day in real time• Real time trade settlement systems• Flight reservation system• Streaming stock data• Real time vehicle location for transportation companies• Stock Exchange Market systems
• System designers normally must support both events and Services
• Systems must be “Business Oriented”
Event Driven ArchitectureWhy do we need EDA?
• Concerns events that are directly related to specific, measurable changes of condition
Event Driven ArchitectureSimple Event Processing
• Both ordinary and notable events happen
Event Driven ArchitectureStream Event Processing
• Allows patterns of simple and ordinary events to be considered to infer that a complex event has occurred
Event Driven ArchitectureComplex Event Processing
SOA-2: Event-Driven Service Oriented Architecture
Event Driven ArchitectureWhat is Complex Event Processing?
time1 2 3 4 5 6 7 8 9
Event Stream Processing Complex Event Processing
Event pattern of significance where prompt detection and action can have materially impact
SOA-2: Event-Driven Service Oriented Architecture
Event Driven ArchitectureWhat is Complex Event Processing?
ALL WITHIN any 2 minute time period
time
Real-
time D
ata St
reams
!
AND ( HPQ’s price moves up by 5%
!
WHEN MSFT price moves outside 2% of MSFT-15-minute-VWAP
!
OR MSFT’s price moves down by 2% )) !
FOLLOWED-BY ( S&P moving by 0.5%
THEN BUY MSFT SELL HPQ
NASDAQ
NYSE
MSFT 15-MIN-VWAP
S&P500
Complex event sequences
Multiple data streams
Real-time constraints Automated actions
Temporal sequencing
Event Driven ArchitectureImplementation Components
Event Driven ArchitectureEvent Processing Engine
• Event Generator• Event Channel• Event Processing Engine• Downstream Activity
Event Driven ArchitectureEvent Flow Layers
SOA-2: Event-Driven Service Oriented Architecture
Event-driven ProcessAutomating the basic process
OTHER SERVICES
OTHER SERVICES
OTHER SERVICES
TRADINGDESK
ORDER MANAGEMENT
SYSTEM
ECN
TRADER
BROKER
EXCHANGE
Investment manager wants order management system integrated with trading desk
SOA-2: Event-Driven Service Oriented Architecture
Event-driven ProcessesOperational improvement
OTHER SERVICES
OTHER SERVICES
ORDER MANAGEMENT
SYSTEM
ECN
COMPLIANCEENGINE
OTHER SERVICES
TRADINGDESK
TRADERFUND MANAGER
INBOUNDTRANSFORMATIONOUTBOUNDTRANSFORMATION
BROKER
EXCHANGE
?
President wants compliance engine to monitor trading activities to eliminate cash liability during market swings
SOA-2: Event-Driven Service Oriented Architecture
Event-driven ProcessesKeeping up with regulations
ORDER MANAGEMENT
SYSTEM
ECN
COMPLIANCE ENGINE
OTHER SERVICES
TRADINGDESK
TRADERFUND MANAGER
BROKER
EXCHANGE
LOGGING SERVICE
OTHER SERVICES
OTHER SERVICES
DB
INBOUNDTRANSFORMATIONOUTBOUNDTRANSFORMATION
?
Board wants trades logged for Sarbanes-Oxley and integrated with company-wide risk management
TOCORPORATERISK MGT
SOA vs EDA
SOA vs EDA
Service Oriented Architecture• Applications are
composed in design-time
• Linear flow between services
• Predictable behavior
• Request/Response is common, and often overused
Event Driven Architecture• Applications are
composed at run-time
• Asynchronous components
• Reactive behavior
• Support strong cohesion in the business processes, situations where all process steps are under one control
• Commonly applied to:• Vertical interaction between the hierarchical layers of
functional decomposition• Functional request-and-reply processes such as man-
machine dialogues; the user waits for an answer• Processes with a transactional nature which require
commit and rollback facilities• Data enrichment in a message to be published to bring
the message to its full content in a formal format
SOA vs EDAWhen to use SOA?
• Support independency between business process steps
• Commonly applied to:• Horizontal communication between
tiers in a process chain• Workflow type of processes• Processes that cross recognizable
functional organization borders, external (B2B) as well as internal
SOA vs EDAWhen to use EDA?
SOA vs EDAVisualization
How to Implement
• Using Web service technologies today, and additional SOAP-aware message queuing infrastructure.
• Current ESB infrastructures provide a way of message queuing combined with Web service technologies.
• SOA and EDA implementations must be regarded in the context of Business Process Management (BPM)
How to Implement
• Modern BPM-tools are based on BPEL (Business Process Execution Language)• Current BPEL implementation focuses strongly on the
command-and-control model, the orchestration of services, and so on SOA
• Beside orchestration BPEL - to a certain extend - also supports workflow, a kind of choreography, which goes in the direction of EDA
• BPEL has a procedural nature
• EDA would rather be a declarative model.
How to Implement
• Preparatory steps:1. Model business requirements into functions at the
granularity level of the desired autonomy.
2. Outline the application landscape to identify all affected systems.
3. Map the application landscape to the business function model.
4. Identify applications that cross functional borders as potential "agility bottlenecks" (assign a special high priority to those applications that are required to cross external organization borders).
• Basis for the decoupled service boundaries
How to ImplementScenarios where SOA and EDA can easily co-exist
Resources
• Enterprise Integration Patterns (Gregor Hohpe and Bobby Woolf )
• Patterns for Enterprise Architecture (Martin Fowler)• SOA Patterns (Arnon Rotem-Gal-Oz, Eric Bruno, Udi
Dahan)
ResourcesBooks
• Event Processing: Designing IT Systems for Agile Companies (K. Chandy , W. Schulte)
• Event-Driven Architecture: How SOA Enables the Real-Time Enterprise (Hugh Taylor, Angela Yochem, Les Phillips, Frank Martinez)
• SOA Design Patterns (The Prentice Hall Service-Oriented Computing Series from Thomas Erl)
ResourcesBooks
• http://soapatterns.net/
• http://www.enterpriseintegrationpatterns.com/
ResourcesSites
Q & A
A sua opinião é importante!Complete o questionário de avaliação e devolva-o à saida.
top related