Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Event driven architecture in practice

2,402 views

Published on

Published in: Technology, Education
  • Be the first to comment

Event driven architecture in practice

  1. 1. Event Driven Architecture in practice Domenico Musto @mimmozzo domenico.musto@gmail.com
  2. 2. Who am I ?
  3. 3. What do I do ? .NET Web REST AgileAutomation Testing C# Team leading Ruby
  4. 4. Agenda • SOA • EDA • Communication patterns • Advantages • Disadvantages • Q & A
  5. 5. Where is Agile going ?
  6. 6. PROCESS MATTERS
  7. 7. CODE MATTERS
  8. 8. Agile = no work upfront
  9. 9. Agile = no work upfront No work upfront = no architecture planning
  10. 10. Architecture is not design
  11. 11. Agile = no work upfront No work upfront = no architecture planning
  12. 12. Agile = no work upfront No work upfront = no architecture planning Agile = no design upfront
  13. 13. We can start now
  14. 14. A big code base…
  15. 15. • Build time • Difficult to test • No real boundaries
  16. 16. Does not scale
  17. 17. Event Driven Architecture
  18. 18. • Architecture is mainly business driven • Business capabilities
  19. 19. Business capability • Owns a part of the system • Well defined responsibilities • Owns a model (set of entities) • Set of components (services, api) • Isolated database • Isolated deploy
  20. 20. SOA
  21. 21. FILES DISCUSSIONS MEETINGS TASKS SOA FLOW
  22. 22. FILES DISCUSSIONS MEETINGS TASKS SOA FLOW
  23. 23. FILES DISCUSSIONS MEETINGS TASKS SOA FLOW
  24. 24. FILES DISCUSSIONS MEETINGS TASKS SOA FLOW
  25. 25. EDA FLOW FILES DISCUSSIONS MEETINGSTASKS COMMUNICATION CHANNEL
  26. 26. Upload document with SOA FILESCLIENT Upload document TASKS NOTIFICATION PREVIEW
  27. 27. Upload document with EDA FILESCLIENT Upload document COMMUNICATION CHANNEL TASKS NOTIFICATION PREVIEW
  28. 28. Communication patterns • Database • Files • Messaging
  29. 29. Channels • Logical address • Datatype
  30. 30. • Events • Commands • Document Messages Types of messages
  31. 31. A simple event • ID • Past sequence • Informing the outside world that something happened
  32. 32. NewDocumentUploaded { Id:1, DocumentId:100 }
  33. 33. Commands SendEmail { Id: 100, To: ‘domenico.musto@gmail.com’, From: ‘info@huddle.com’, Subject: ‘Welcome to huddle’, Content: ‘Enjoy’ }
  34. 34. Document Message UserRegistered { Id: 100, Name: ‘Domenico’, LastName: ‘Musto’, Email: ‘domenico.musto@gmail.com’, Twitter: ‘@mimmozzo’, Avatar: ‘http://my.huddle.net/mimmozzo/avatar’ }
  35. 35. Reference Data
  36. 36. COMM. CHANNEL NOTIFICATION NewDocumentUploaded { Id:1, DocumentId:100, WorkspaceId:200 } FILES
  37. 37. PEOPLE COMM.CHANNEL UserRegistered { Id: 100, Name: ‘Domenico’, LastName: ‘Musto’, Email: ‘domenico.musto@gmail.com’, Address: ‘London’, Twitter: ‘@mimmozzo’, Avatar: ‘http://my.huddle.net/mimmozzo/avatar’ }
  38. 38. COMM. CHANNEL NOTIFICATION Recipient Id : int Email : string
  39. 39. Eventual consistency
  40. 40. PEOPLE COMM.CHANNEL UserUpdated { Id: 100, Email: ‘mynewemail@gmail.com’ SomeField: ‘some_value’ } NOTIFICATION
  41. 41. COMM. CHANNEL NOTIFICATION RECIPIENTS
  42. 42. Messages order
  43. 43. Versioning
  44. 44. PEOPLE COMM.CHANNEL UserUpdated { Id: 100, Email: ‘mynewemail@gmail.com’, SomeField: ‘some_value’, Version: 3 } COMM. CHANNEL NOTIFICATION Recipient Id : 100 Email : ‘oldmail@gmail.com’ Version: 1
  45. 45. PEOPLE COMM.CHANNEL UserUpdated { Id: 100, Email: ‘mynewemail@gmail.com’, SomeField: ‘some_value’, Version: 2 } COMM. CHANNEL NOTIFICATION Recipient Id : 100 Email : ‘email@gmail.com’ Version: 3
  46. 46. Idempotency
  47. 47. Ability to replay messages
  48. 48. Events publisher
  49. 49. PEOPLE PEOPLE EVENTS PEOPLE EVENT PUBLISHER COMMUNICATION CHANNEL
  50. 50. Testing
  51. 51. Our infrastructure • RabbitMQ • Reactive Extensions • JSON as message format
  52. 52. Business monitoring
  53. 53. Big picture
  54. 54. Thanks. @mimmozzo domenico.musto@gmail.com

×