Event Driven Architecture at NDDNUG

1,951 views

Published on

Presentation given at the North Dallas .NET Users Group in February, 2010

Published in: Technology
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,951
On SlideShare
0
From Embeds
0
Number of Embeds
20
Actions
Shares
0
Downloads
76
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide
  • Soft real time systems
  • Soft real time systems
  • Event Driven Architecture at NDDNUG

    1. 1. EVENT DRIVEN ARCHITECTURE Chris Patterson Senior Architect, RelayHealth Chris@PhatBoyG.com
    2. 2. Agenda Review Enterprise Application Integration Introduce Event Driven Architecture Define Events .NET sample using MassTransit
    3. 3. About Me Enterprise Software Architect 20+ years in commercial software development 12+ years at a Fortune 15 company Proven history with distributed, real-time systems 2009 - Awarded Microsoft Visual C# MVP
    4. 4. ENTERPRISE APPLICATION INTEGRATION
    5. 5. ENTERPRISE APPLICATION INTEGRATION Linking applications in an organization together to simplify and automate business processes
    6. 6. Shared Database Multiple applications coupled to single schema Unclear ownership of schema Blurred application boundaries Linked servers (SQL to SQL RPC) Changes often affect multiple applications
    7. 7. File Transfer
    8. 8. File Transfer Extract - Transform - Load (ETL)
    9. 9. File Transfer Extract - Transform - Load (ETL) Asynchronous
    10. 10. File Transfer Extract - Transform - Load (ETL) Asynchronous Simple interoperability through common formats
    11. 11. File Transfer Extract - Transform - Load (ETL) Asynchronous Simple interoperability through common formats Timeliness of data can lead to inconsistencies
    12. 12. 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
    13. 13. 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
    14. 14. 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
    15. 15. RPC Exchange Prepare Call Return Process
    16. 16. RPC Exchange Prepare Call Return Process
    17. 17. RPC Exchange e bl ia Prepare Call el nr U re As rk Return Process wo et N
    18. 18. MESSAGING
    19. 19. Message Exchange Create Process Send Receive
    20. 20. A-Synchronicity Message producers are non-blocking Fire and forget Message consumers run in their own process Introduces a more complex programming model
    21. 21. Minimized Coupling Eliminates temporal coupling Enables isolated testing of services Reduces dependencies, increasing service reuse
    22. 22. 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
    23. 23. Fault Tolerance Messages improve recoverability Durable message transports
    24. 24. Data Availability Enables small, frequent transfers of related content Distribute system load over a wider time window
    25. 25. EVENT DRIVEN ARCHITECTURE
    26. 26. EVENT DRIVEN ARCHITECTURE A method of building enterprise systems in which events flow between decoupled components and services
    27. 27. Another Architecture? Service Oriented Event Driven Architecture Architecture
    28. 28. Service Oriented Event Driven Architecture Architecture Complimentary
    29. 29. Service Oriented Event Driven Architecture Architecture Complimentary
    30. 30. 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
    31. 31. Event Driven Architecture Components are assembled at run-time Asynchronous programming model Reactive behavior Leverages one way, fire and forget, messaging
    32. 32. 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
    33. 33. Event Producers Publish events Oblivious to consumer reactions Unaffected by high number of consumers
    34. 34. Event Consumers React to events Subscribe by topic/type/selector Asynchronous operation
    35. 35. Business Components Logical grouping of autonomous components Represent a complete business process
    36. 36. COMMANDS
    37. 37. 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)
    38. 38. Reset Password User initiates a password reset Password service sends reset email User clicks link in email
    39. 39. Message Body public class ResetPassword { public Guid RequestId { get; set; } public string Username { get; set; } }
    40. 40. Compared To... public void ResetPassword(string username) public class ResetPassword { public Guid RequestId { get; set; } public string Username { get; set; } }
    41. 41. EVENTS
    42. 42. Pablo’s Fiesta! February 26, 27, 28 Austin, TX Open Spaces fiesta.lostechies.com
    43. 43. EVENTS
    44. 44. EVENTS Represent a change in state
    45. 45. 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
    46. 46. Identified Each event should have its own unique identifier
    47. 47. Related Related events should share a common identifier Allows event tracing (the new F11) Assists in combining events into processes
    48. 48. Observed Events are published as messages Multiple components can subscribe to the same event
    49. 49. EVENT TYPES
    50. 50. Business Events Map to real world events that occur in business Item Added to Cart Invoice Received Order Shipped Payment Requested
    51. 51. 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
    52. 52. 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
    53. 53. MassTransit Key Points Lightweight Service Bus Implementation Loose coupling via publish/subscribe Active Service Pattern Supports MSMQ, RabbitMQ, ActiveMQ, TIBCO EMS Open Source, Apache 2.0 License
    54. 54. “EVENT DRIVEN ARCHITECTURE IS... programming without a call stack.” -Gregor Hohpe, Google
    55. 55. Testing Individual components testable in isolation Fully unit-testable using mocks and stubs Test-first development helps improve data contract
    56. 56. Logging Thorough logging with correlation information Log level configurable at runtime
    57. 57. Visualization Tools Present code-based logic in a visual form Aid in identifying composition problems Should be viewable on operational systems
    58. 58. GITTING MASSTRANSIT
    59. 59. Source Repository
    60. 60. Latest Build
    61. 61. Documentation
    62. 62. FOR MORE INFORMATION
    63. 63. Reading Material
    64. 64. Reading Material
    65. 65. Reading Material
    66. 66. Reading Material
    67. 67. Reading Material
    68. 68. Reading Material
    69. 69. Reading Material
    70. 70. CONTACT ME Chris@PhatBoyG.com http://PhatBoyG.LosTechies.com twitter: @PhatBoyG voice: text “cmp” to 50500

    ×