Domain Driven Design with CQRS and Event Sourcing

Domain Driven Design with CQRS and Event Sourcing

Domain Driven Design, CQRS and Event Sourcing presentation made during Node.js Paris meetup (https://www.meetup.com/fr-FR/Nodejs-Paris/events/263358579/)

9298dcce5b2b0e88d8ffbb837192ca98?s=128

Sylvain Pontoreau

January 08, 2020
Tweet

Transcript

  1. None
  2. None
  3. None
  4. ! if(this.authProvider.validate(token)) { this.service .send(session.get("user_basket")); }

  5. • ⚠ • • ℹ • •

  6. None
  7. • • • • • • • • •

  8. !=

  9. Actor Behavior Aggregate Event View Command

  10. Actor Behavior Aggregate Event Command

  11. None
  12. None
  13. None
  14. • • • • • • ⚠

  15. CQRS GetBalance Query Deposite Command GetAllOperation Query Withdraw Command …

    … Dispatcher Read DB Dispatcher QueryHandler CommandHandler Write DB Validation Plugin Monitoring Plugin Cache Plugin … ⚠ Eventual consistency
  16. None
  17. • What is Event Sourcing? • Capture all domain changes

    as a sequence of events (stream) • Every changes in the domain are represented by events • Events are immutable • Event Store will be the single point of truth • Useful for: • Auditing • Debug • Fix inconsistency • Description of the pattern by Martin Fowler: https://martinfowler.com/eaaDev/EventSourcing.html Event Sourcing
  18. • • • • • • • • • •

    • •
  19. CQRS & Event Sourcing GetBalance Query Deposite Command GetAllOperation Query

    Withdraw Command … … Dispatcher Read DB Dispatcher QueryHandler CommandHandler Event Store Projection Projection Aggregate State Events Behaviors
  20. None
  21. • • • • • • • • • •

    • •
  22. None