• Save
Event Driven Architecture
Upcoming SlideShare
Loading in...5

Event Driven Architecture



Presentation given at Saint Louis Day of .NET

Presentation given at Saint Louis Day of .NET



Total Views
Views on SlideShare
Embed Views



3 Embeds 19

http://www.linkedin.com 14
https://www.linkedin.com 4
http://www.slideshare.net 1


Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment
  • Soft real time systems

Event Driven Architecture Event Driven Architecture Presentation Transcript

  • EVENT DRIVEN ARCHITECTURE Chris Patterson Senior Architect, RelayHealth chris@phatboyg.com
  • EVENT DRIVEN ARCHITECTURE Chris Patterson Senior Architect, RelayHealth
  • Agenda Review Enterprise Application Integration Introduce Event Driven Architecture Define Events .NET sample using MassTransit
  • About Me Enterprise Software Architect 20+ years in commercial software development 11+ years at a Fortune 15 company Proven history with distributed, real-time systems Microsoft Visual C# MVP
  • ENTERPRISE APPLICATION INTEGRATION Linking applications in an organization together to simplify and automate business processes
  • Shared Database Multiple applications coupled to single schema Unclear ownership of schema Edges between applications blurred Linked servers for SQL to SQL RPC Changes often affect multiple applications
  • File Transfer Extract - Transform - Load (ETL) Asynchronous Simple interoperability through common formats Timeliness of data can lead to inconsistencies Large data volume containing unrelated data Ownership of files, cleanup, versioning
  • Web Services Explicit Contract (WSDL, DataContract) Synchronous Operation leads to sequencing Services must be available at invocation Nested call stacks fragile, consume resources Remote Procedure Call (RPC, COM, CORBA) The network is unreliable
  • Message Exchange Create Process Send Receive
  • A-Synchronicity Message producers are non-blocking Fire and forget Message consumers run in their own process Introduces a more complex programming model
  • Minimized Coupling Eliminates temporal coupling Enables isolated testing of services Reduces dependencies, increasing service reuse
  • Explicit Contract Agreement between producer and consumer Internal data structure remains private Integration points remain at the application’s edge Eliminates propagation of internal changes
  • Fault Tolerance Messages improve recoverability Durable message transports
  • Data Availability Enables small, frequent transfers of related content Distribute system load over a wider time window
  • EVENT DRIVEN ARCHITECTURE A method of building enterprise systems in which events flow between decoupled components and services
  • Another Architecture? Service Oriented Event Driven Architecture Architecture
  • Service Oriented Event Driven Architecture Architecture Complimentary
  • Service Oriented Event Driven Architecture Architecture Complimentary
  • SOA 1.0 Applications are composed using a designer Synchronous programming model Step-by-step (F10) flow through services Majority of interactions are request/response
  • Event Driven Architecture Components are assembled at run-time Asynchronous programming model Reactive behavior Leverages one way, fire and forget, messaging
  • Autonomous Components Defined by responsibility Independent Self-governing - makes decisions on how to react Self-controlling - responsible for execution context Self-contained - not part of an application
  • Event Producers Publish events Oblivious to consumer reactions Unaffected by high number of consumers
  • Event Consumers React to events Subscribe by topic/type/selector Asynchronous operation
  • Business Components Logical grouping of autonomous components Represent a complete business process
  • Commands Tell a component or service to do something Initiated by an event, interaction, etc. Use correlation for tracing, idempotence Sent using messaging (not published)
  • Reset Password User initiates a password reset Password service sends reset email User clicks link in email
  • Message Body public class ResetPassword { public Guid RequestId { get; set; } public string Username { get; set; } }
  • Compared To... public void ResetPassword(string username) public class ResetPassword { public Guid RequestId { get; set; } public string Username { get; set; } }
  • EVENTS Represent a change in state
  • Self Contained A pure and complete representation of a specific event Time relevant, not time sensitive Avoid references to internal data Reduces dependencies, loosens coupling
  • Identified Each event should have its own unique identifier
  • Related Related events should share a common identifier Allows event tracing (the new F11) Assists in combining events into processes
  • Observed Events are published as messages Multiple components can subscribe to the same event
  • Business Events Map to real world events that occur in business Item Added to Cart Invoice Received Order Shipped Payment Requested
  • Lifecycle Events Notifications related to the life of a state or process Preparing Shipment / Shipment Prepared Authorizing Payment / Payment Authorization Complete Session Started / Session Completed
  • Management Events Relate events to time, ranges, limits Timely Service Guarantee Exceeded Your order within five minutes, or it’s free Popular Item Notification Items with a 5x increase in sales in an hour
  • 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
  • “EVENT DRIVEN ARCHITECTURE IS... programming without a call stack.” -Gregor Hohpe, Google
  • Testing Individual components testable in isolation Fully unit-testable using mocks and stubs Test-first development helps improve data contract
  • Logging Thorough logging with correlation information Log level configurable at runtime
  • Visualization Tools Present code-based logic in a visual form Aid in identifying composition problems Should be viewable on operational systems
  • Reading Material
  • Reading Material
  • Reading Material
  • Reading Material
  • Reading Material
  • Reading Material
  • Reading Material
  • Web Sites MassTransit.GoogleCode.com Topshelf.GoogleCode.com Magnum.GoogleCode.com
  • CONTACT ME Chris@PhatBoyG.com http://PhatBoyG.LosTechies.com twitter: @PhatBoyG voice: text “cmp” to 50500