Event Driven Architecture

3,961 views
3,842 views

Published on

In this presentation, I will explain event driven architecture, describe the different types of events, demonstrate how events can be related and orchestrated, and provide a basic understanding of how this method can drive the architecture of enterprise systems. In addition to understanding the concepts of event driven architecture, we will explore a working sample built using an open-source .NET messaging framework called MassTransit.

0 Comments
8 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,961
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
8
Embeds 0
No embeds

No notes for slide

Event Driven Architecture

  1. 1. Event Driven Architecture Chris Patterson Senior Architect, RelayHealth chris@phatboyg.com
  2. 2. Agenda Enterprise Application Integration (EA-eye) Events Event Driven Architecture (ED-eh) .NET sample using MassTransit
  3. 3. About Me Enterprise Software Architect Over 20 years of software development experience Over 11 years at a Fortune 15 company Proven track record with distributed, real-time systems
  4. 4. Enterprise Application Integration
  5. 5. Enterprise Application Integration The process of linking applications within a single organization together in order to simplify and automate business processes While avoiding sweeping changes to existing applications
  6. 6. File Transfer Applications export and import files Use various formats, requiring translation Often loaded manually, infrequently Affectionately known as ETL or SSIS
  7. 7. Shared Database The mastermind of the axis of evil Data is tightly coupled to multiple applications Incremental, partial upgrade of application impossible Primary reason for “forklift upgrades”
  8. 8. Web Services Requires service to be available at invocation Results in multiple call stacks, consuming resources Yet another Remote Procedure Call (RPC, COM, CORBA)
  9. 9. Messaging
  10. 10. Messaging
  11. 11. Messaging Defined data format Asynchronous operation Minimized coupling Fault tolerance Data Freshness
  12. 12. Defined Data Format Mutual contract between producer and consumer Internal formats remain private Integration code remains at the edge of the application, preventing internal changes from impacting the interface
  13. 13. Asynchronous Operation Processes run in their own execution context Originating process continues Services need not be available at all times
  14. 14. Minimized Coupling Additive model reduces change to existing systems Reduces dependencies, increasing service reuse Enables isolated testing of services
  15. 15. Fault Tolerance Durable messaging improves recoverability Compensating actions to handle partial failure
  16. 16. Data Freshness Favors small data transfers of related data compared to big files containing unrelated content Minimizes data exchange latency
  17. 17. Events
  18. 18. Events Represent a change in state Self-contained Uniquely Identifiable Time relevant, not time sensitive Sourced using messaging
  19. 19. Unique Identification Enables idempotent handling of events Improve traceability of related processing Allows correlation with related events
  20. 20. Self Contained A pure and complete representation of a specific event No references to other data sources No need to time sync to an additional source Reduces dependencies, loosens coupling
  21. 21. Observable Published events can be observed by multiple subscribers Event stream processing
  22. 22. Event Types
  23. 23. Execution Events Define the process flow Order Coffee Customer placed an order for coffee Present Coffee Coffee handed to customer
  24. 24. Lifecycle Events Bookends around the process Preparing Coffee Barista began preparing a coffee Coffee Prepared Barista finished preparing a coffee
  25. 25. Management Events Time period elapsed, Range or limit exceeded Order Guarantee Exceeded Your order within five minutes, or it’s free Caffeine Junkie Alert Orders of ten or more coffees require approval by FDA
  26. 26. Business Events Found by observing the natural order of the business Coffee Order Fulfilled A coffee was ordered, prepared, and delivered Material Shipment Arrived Beans, milk, and cups delivered by brown
  27. 27. Event Driven Architecture
  28. 28. Event Driven Architecture A method of building enterprise systems in which events flow between decoupled components and services A maintainable, sustainable, and extensible model for building complex, distributed applications Well suited for asynchronous, unpredictable environments
  29. 29. How is it different from SOA?
  30. 30. How is it different from SOA? Event Driven Architecture complements Service Oriented Architecture
  31. 31. Service Oriented Architecture Applications are composed at design-time Linear flow between services Predictable behavior Request/Response is common, overused
  32. 32. Event Driven Architecture Applications are composed at run-time Asynchronous components Reactive behavior Natural fit for distributed systems
  33. 33. Autonomous Components Triggered in response to an event Independent - no coupling to event producer Self-governing - makes decisions on how to react Self-controlling - responsible for execution context Self-contained - not part of an application
  34. 34. Event Producers Publish messages representing an event Often oblivious to the consequences of the generated event
  35. 35. Event Consumers Subscribe to events by topic/type/selector Handle events asynchronously No performance penalty for additional consumers
  36. 36. MassTransit Key Points Lightweight Service Bus Implementation Loose coupling via publish/subscribe Active Service Pattern Supports MSMQ, ActiveMQ, TIBCO EMS Open Source, Apache 2.0 License
  37. 37. “Event Driven Architecture is... programming without a call stack.” -Gregor Hohpe, Google
  38. 38. Testing Individual components testable in isolation Fully unit-testable using mocks and stubs Test-first development helps improve data contract
  39. 39. Debugging Logging Visualization Tools
  40. 40. Logging Thorough logging with correlation information Adjustable output configurable at runtime
  41. 41. Visualization Tools Present code-based logic in a visual form Aid in identifying composition problems Should be viewable on operational systems
  42. 42. For More Information
  43. 43. Reading Material
  44. 44. Reading Material
  45. 45. Reading Material
  46. 46. Reading Material
  47. 47. Reading Material
  48. 48. Reading Material
  49. 49. Reading Material Enterprise Integration Patterns (Hohpe, Woolf) Patterns of Enterprise Application Architecture (Fowler) SOA Patterns (Arnon Rotem-Gal-Oz, Eric Bruno, Udi Dahan)
  50. 50. Web Sites MassTransit - http://masstransit.googlecode.com/ Topshelf - http://topshelf.googlecode.com/ Magnum - http://magnum.googlecode.com/
  51. 51. Contact Me Chris@PhatBoyG.com http://blog.PhatBoyG.com http://twitter.com/PhatBoyG http://PhatBoyG.LosTechies.com

×