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

Introduction to DDD, CQRS, and Event Sourcing w...

Avatar for m1l4n54v1c m1l4n54v1c
September 06, 2018

Introduction to DDD, CQRS, and Event Sourcing with Axon Framework

Covers basic principles of Domain Driven Design, Command Query Responsibility Segregation and Event Sourcing.

Gives an introduction to the Axon Framework with a code example available at https://github.com/m1l4n54v1c/meetup

Avatar for m1l4n54v1c

m1l4n54v1c

September 06, 2018
Tweet

More Decks by m1l4n54v1c

Other Decks in Programming

Transcript

  1. Introduction to DDD, CQRS, and Event Sourcing with Axon Framework

    Milan Savić Software Engineer @ AxonIQ [email protected] MilanSavic14
  2. Rich Domain Model VS Anemic Model • Contains all business

    rules • Requires time • Contains state & behavior • Has clear boundaries • Easier to refactor • Follows OOP • Business rules are scattered • Can be implemented quickly • Contains only state • Boundaries are not clear • Not so easy to refactor • Feels more like procedural programming
  3. DDD is about mapping business domain concepts into software artifacts.

    Source: https://www.infoq.com/articles/ddd-in-practice
  4. Command Query Responsibility Segregation • A command changes the state

    of an object, but does not return any data, while • a query returns data and does not change any state.
  5. Why CQRS? • Simpler, faster queries • Scaling reads and

    writes separately • Choosing the correct data storage • Enabling Event Sourcing
  6. Event Sourcing • Events as a single source of truth

    in the system • Full audit log • State is always recreated from events (snapshots) • Efficient writes • Food for ML and BigData
  7. Vision & Strategy - Originally • CQRS Framework for Java

    • However • CQRS is not the goal • CQRS is optional • Event Sourcing is optional • DDD is optional
  8. $

  9. Event-driven thinking in design, architecture, technology and organization with: Russ

    Miles, Allard Buijze, Alberto Brandolini, Mathias Verraes, Frans van Buul, and more… Register at: axoniq.io/conference
  10. Zero-config location transparency & elastic scalability Application structure insight Manage

    (tracking) processors (including dynamic scaling) Fast & reliable storage of unbounded events streams Optimized for Event Sourcing