Upgrade to Pro — share decks privately, control downloads, hide ads and more …

TechDays 2017 - Scalable Enterprise Applications with CQRS and Service Fabric

TechDays 2017 - Scalable Enterprise Applications with CQRS and Service Fabric

In this session we will show how we use CQRS and event sourcing to deploy our ERP solution on Service Fabric. We will talk about the pitfalls and the lessons learned. But we will also talk about how we keep this maintainable and testable by applying the ports and adapters approach from hexagonal architecture.

Michiel Overeem

October 13, 2017
Tweet

More Decks by Michiel Overeem

Other Decks in Technology

Transcript

  1. [email protected]
    @michielovereem

    View Slide

  2. 400+ employees (4 locations)
    10.500 customers (companies)
    AFAS Software

    View Slide

  3. HRM, CRM, finance, order
    management, project
    management, workflow, ...
    AFAS Profit

    View Slide

  4. Filmpje mark (eerste plaat van het filmpje hier)
    4752 cores, 70 TB RAM, 380 TB SSD storage
    18.000 concurrent RDP users
    450.000 unique users a month
    5.600.000 API calls a day
    AFAS Online (89% customers)

    View Slide

  5. View Slide

  6. Client
    Command system
    Query system
    Eventing system

    View Slide

  7. Client
    Command system
    Query system
    Eventing system
    “PlaceOrderCommand”: {
    “OrderId”: “0b81b458-7671-4e9b-844b-9934255f5406”,
    “CustomerName”: “Linus Torvalds”,
    “OrderLines”: [ … ]
    }

    View Slide

  8. Client
    Command system
    Query system
    Eventing system
    The command system validates the
    command, using its own datamodel.

    View Slide

  9. Client
    Command system
    Query system
    Eventing system
    “OrderPlacedEvent”: {
    “OrderId”: “0b81b458-7671-4e9b-844b-9934255f5406”,
    “CustomerName”: “Linus Torvalds”,
    “OrderLines”: [ … ]
    }

    View Slide

  10. Client
    Command system
    Query system
    Eventing system
    Broadcasts the events to
    the query system.

    View Slide

  11. Client
    Command system
    Query system
    Eventing system
    Projection of data
    optimized for quering.

    View Slide

  12. Client
    Command system
    Query system
    Eventing system
    “GetPlacedOrdersQuery”: {
    “CustomerName”: “Linus Torvalds”
    }

    View Slide

  13. Client
    Command system
    Query system
    Eventing system
    And responds to queries
    send by the client.

    View Slide

  14. Client
    Command system
    Query system
    Eventing system
    Use the events published to built up the
    state in the Command system.

    View Slide

  15. Client
    Command system
    Query system
    Eventing system
    Use the events published to built up the
    state in the Command system.

    View Slide

  16. Client
    Command system
    Query system
    Eventing system

    View Slide

  17. View Slide

  18. View Slide

  19. View Slide

  20. Next Generation ERP

    View Slide

  21. Client
    Command system
    Query system
    Eventing system

    View Slide

  22. Client
    Command system
    Query system
    Eventing system

    View Slide

  23. View Slide

  24. Client
    Command system
    Query system
    Eventing system
    “PlaceOrderCommand”: {
    “OrderId”: “0b81b458-7671-4e9b-844b-9934255f5406”,
    “CustomerName”: “Linus Torvalds”,
    “OrderLines”: [ … ]
    }

    View Slide

  25. Client
    Command system
    Query system
    Eventing system
    “OrderPlacedEvent”: {
    “OrderId”: “0b81b458-7671-4e9b-844b-9934255f5406”,
    “CustomerName”: “Linus Torvalds”,
    “OrderLines”: [ … ]
    }

    View Slide

  26. Client
    Query system
    Eventing system
    Load balancer

    View Slide

  27. View Slide

  28. View Slide

  29. View Slide

  30. View Slide

  31. View Slide

  32. View Slide

  33. View Slide

  34. Client
    Query system
    Eventing system
    Load balancer
    “PlaceOrderCommand”: {
    “OrderId”: “0b81b458-7671-4e9b-844b-9934255f5406”,
    “CustomerName”: “Linus Torvalds”,
    “OrderLines”: [ … ]
    }

    View Slide

  35. View Slide

  36. View Slide

  37. Client
    Command system
    Query system
    Eventing system

    View Slide

  38. Client
    Command system
    Query system
    Eventing system
    “OrderPlacedEvent”: {
    “OrderId”: “0b81b458-7671-4e9b-844b-9934255f5406”,
    “CustomerName”: “Linus Torvalds”,
    “OrderLines”: [ … ]
    }

    View Slide

  39. Client
    Command system
    Query system
    Eventing system

    View Slide

  40. Client
    Command system
    Eventing system
    Load balancer

    View Slide

  41. View Slide

  42. View Slide

  43. View Slide

  44. View Slide

  45. View Slide

  46. View Slide

  47. Client
    Command system
    Eventing system
    Load balancer

    View Slide

  48. View Slide

  49. View Slide

  50. Client
    Command system
    Eventing system
    Load balancer

    View Slide

  51. View Slide

  52. View Slide

  53. View Slide

  54. are made, the system

    View Slide

  55. Client
    Load balancer

    View Slide

  56. Client
    Load balancer

    View Slide

  57. View Slide

  58. Client
    Load Balancer

    View Slide

  59. Client
    Load Balancer

    View Slide

  60. Client
    Load Balancer

    View Slide

  61. View Slide

  62. View Slide

  63. View Slide

  64. View Slide

  65. Client
    Load Balancer

    View Slide

  66. Client
    Load Balancer

    View Slide

  67. Client
    Load Balancer

    View Slide

  68. Client
    Load Balancer

    View Slide

  69. Client
    Load Balancer

    View Slide

  70. Client
    Load Balancer

    View Slide

  71. Client
    Load Balancer

    View Slide

  72. Client
    Load Balancer

    View Slide

  73. [email protected]
    @michielovereem
    https://dev.afas.nl

    View Slide