SlideShare a Scribd company logo
1 of 30
Beyond DDD 101 A practice report on building multi
bounded context CQRS/ES applications
Jan Galinski & Simon Zambrovski
Amsterdam, 23.09.2022
1
Who we are
Jan Galinski
Simon Zambrovski
23.09.2022, AxonIQCon 2022 2
Consultants @ holisticon
Backend developers, software architects
DDD, CQRS/ES, Axon Framework, Spring, Kotlin, Java
What is Holisticon
• IT Consulting
• Hamburg, Hannover, Kiel
• Cool crew
• Best Employer 2022
in Hamburg
• We are hiring!
23.09.2022, AxonIQCon 2022 3
BESTE BERATUNG – BESTE SOFTWARE
Motivation
• We love architecture
• DDD
• CQRS
• Event Sourcing
• Large-scale applications running on JVM
• We love Axon Framework
• We want to share our experience
23.09.2022, AxonIQCon 2022 4
https://www.pexels.com/de-de/foto/verschiedene-puzzlespiele-1586951/
Foundation – Theory - DDD
• Set of principles for system implementation
• Requirement Engineering
• Domain Modeling
• Strategic Design
• Bounded Context identification
• Context Mapping
• Design
• Ubiquitous Language
• Design Patterns
23.09.2022, AxonIQCon 2022 5
https://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215
Foundation – Theory – DDD Patterns
• Modeling of Bounded Context relationships (for Microservices)
• Separate Ways
• Upstream/Downstream
• Open Host Service + Published Language
• Anti Corruption Layer
• Tactical Design
• Value Object, Entity, Aggregate, Aggregate Root
• Domain Service, Factory, Repository
• Domain Event
• Saga Pattern
23.09.2022, AxonIQCon 2022 6
Foundation – Theory – CQRS/ES
• Command Query Responsibility Segregation Pattern
• Reduce complexity of Domain model
• Separate Command model from Query model (optimized)
• Scale-out independently
• Event Sourcing Persistence Strategy
• Store Domain Events (versus store State)
• Derive State from Domain Event stream
• CQRS/ES
• Use Domain Events to communicate between Command and Query models
• Allow late stream consumption (stream replay)
23.09.2022, AxonIQCon 2022 7
Domain
Foundation - Onion Architecture
Driving
(primary)
Adapter
Driven
(secondary)
Adapter
Domain
Model
Ring
Port Port
Application Service Ring
Infrastructure Ring
23.09.2022, AxonIQCon 2022 8
Axon Framework 101
• FOSS framework in Java for building DDD CQRS(/ES) systems
• Explicit message concept
• 3 buses for decoupling
• Command -> Addressed intent of a change, may fail, unicast
• Event -> Fact, broadcast
• Query -> Request for data, has result, multicast
• Domain Model Segregation (implements CQRS)
• Event Sourcing implementation (different Event Stores)
• Separation of business logic from configuration
23.09.2022, AxonIQCon 2022 9
https://developer.axoniq.io/download
Possible Architecture using Axon Framework
23.09.2022, AxonIQCon 2022 10
https://docs.axoniq.io/reference-guide/
System evolution in single context
• Build components using buses for communication
• Start with modulith
• Distribute along buses
• Scale out projections
• Build new projections later
• Change infrastructure
23.09.2022, AxonIQCon 2022 11
Domain Core
Onion Architecture with Axon Framework
REST
Adapter
Query Model
Command Model
Command
Gateway
Query
Gateway
Projection
Repository
Aggregate
Repository
Query
Bus
Comma
nd Bus
Event
Bus
Pivotal
Event
Bus
Pivotal
Event
Bus
Domain
Event
Bus
Domain
Comma
nd Bus
Query
Bus
Saga
23.09.2022, AxonIQCon 2022 12
23.09.2022, AxonIQCon 2022 13
https://www.pexels.com/de-de/foto/mann-frustration-kopfschmerzen-brille-9843268/
Domain Core
Onion Architecture with Axon Framework
REST
Adapter
Query Model
Command Model
Command
Gateway
Query
Gateway
Projection
Repository
Aggregate
Repository
Query
Bus
Comma
nd Bus
Event
Bus
Pivotal
Event
Bus
Pivotal
Event
Bus
Domain
Event
Bus
Domain
Comma
nd Bus
Query
Bus
Saga
23.09.2022, AxonIQCon 2022 14
Simplified context building block
Query Model
Command Model
Query
Bus
Comma
nd Bus
Event
Bus
Event
Bus
Comma
nd Bus
Query
Bus
Saga
23.09.2022, AxonIQCon 2022 15
Patterns
23.09.2022, AxonIQCon 2022 16
Q
S
C
? Q
S
C
Q
Master Data Query
Q
S
D U
23.09.2022, AxonIQCon 2022 17
„You know some things that I need to know, please tell me!“
Query
Master Data Query
Q
S
Q
D U
23.09.2022, AxonIQCon 2022 18
Query
Benefits
• Simple (~ GET)
• No redundancy (GDPR)
• Encapsulate complex business
logic
Challenges
• Runtime dependency
• Trap: Building specialized
projections for other teams
• Outdated data, caching
Trigger a query
C
U D
23.09.2022, AxonIQCon 2022 19
Q Q
„I made some changes … ask me if you want more details.“
Query
C‘
Trigger a query
C
U D
23.09.2022, AxonIQCon 2022 20
Q Q
Query
Benefits
•„Cache invalidation“
Challenges
•Runtime dependency*
•Load (query avalanche)
Query Aggregator
C
Q
U D
23.09.2022, AxonIQCon 2022 21
„Here is some data that could be useful to build your projection.“
Query
Q‘
C‘
Query Aggregator
C
Q
U D
23.09.2022, AxonIQCon 2022 22
Query
Benefits
• Decoupling
• Build complex projections
from other contexts
Challenges
• Event Payload definition
• Payload interpretation
Reacting to Fact
C
S
C
U D
23.09.2022, AxonIQCon 2022 23
Command
„I changed some things … deal with it.“
C‘ C‘
Reacting to Fact
C
S
C
U D
23.09.2022, AxonIQCon 2022 24
Command
Benefits
• Simple
• Decoupled
• Event Driven
Challenges
• Downstream Command model
must follow
• Command-Event-Command
bridge
Downstream Saga
C
S
C
D U
23.09.2022, AxonIQCon 2022 25
Command
„I need you to do something for me, and I need the result.“
C*
C‘ C‘
Downstream Saga
C
S
C
D U
23.09.2022, AxonIQCon 2022 26
Command
Benefits
• Build for failure
• Delegate sub processes
Challenges
• Compensation
• Complex for more than
one context
External Orchestrator
C
S
C
D U
U
23.09.2022, AxonIQCon 2022 27
Command
C*
C* C‘
C‘
„If you two cannot handle it, let me take control.“
External Orchestrator
C
S
C
D U
U
23.09.2022, AxonIQCon 2022 28
Command
Benefits
• Build for failure
• Separate ways
• Business process
Challenges
• Compensation
• Complex for more than one
context
Key Takeaways
• Domain Driven Design
• Start with Strategic Design
• Do proper Context Mapping – Relationships!
• CQRS/ES
• Use Command / Event / Query abstractions („Events only“ is not enough)
• Use Axon Framework if working on JVM
• Practical
• Start with a modulith
• Build evolutionary
• Distribute on demand
23.09.2022, AxonIQCon 2022 29
Thank you... Questions?
• Holisticon AG
• https://holisticon.de/
• Jan
• https://about.me/jangalinski
• Simon
• https://about.me/zambrovski
• Axon Framework
• https://developer.axoniq.io/
23.09.2022, AxonIQCon 2022 30
https://www.pexels.com/de-de/foto/fragezeichen-auf-zerknittertem-papier-5428826/

More Related Content

What's hot

Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...Amazon Web Services
 
Microservices Part 3 Service Mesh and Kafka
Microservices Part 3 Service Mesh and KafkaMicroservices Part 3 Service Mesh and Kafka
Microservices Part 3 Service Mesh and KafkaAraf Karsh Hamid
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architectureThe Software House
 
아키텍처 현대화 분야 신규 서비스 - 주성식, AWS 솔루션즈 아키텍트 :: AWS re:Invent re:Cap 2021
아키텍처 현대화 분야 신규 서비스 - 주성식, AWS 솔루션즈 아키텍트 :: AWS re:Invent re:Cap 2021아키텍처 현대화 분야 신규 서비스 - 주성식, AWS 솔루션즈 아키텍트 :: AWS re:Invent re:Cap 2021
아키텍처 현대화 분야 신규 서비스 - 주성식, AWS 솔루션즈 아키텍트 :: AWS re:Invent re:Cap 2021Amazon Web Services Korea
 
Introduction to AWS Step Functions:
Introduction to AWS Step Functions: Introduction to AWS Step Functions:
Introduction to AWS Step Functions: Amazon Web Services
 
Building Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache KafkaBuilding Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache KafkaGuido Schmutz
 
Amazon Personalize Event Tracker 실시간 고객 반응을 고려한 추천::김태수, 솔루션즈 아키텍트, AWS::AWS ...
Amazon Personalize Event Tracker 실시간 고객 반응을 고려한 추천::김태수, 솔루션즈 아키텍트, AWS::AWS ...Amazon Personalize Event Tracker 실시간 고객 반응을 고려한 추천::김태수, 솔루션즈 아키텍트, AWS::AWS ...
Amazon Personalize Event Tracker 실시간 고객 반응을 고려한 추천::김태수, 솔루션즈 아키텍트, AWS::AWS ...Amazon Web Services Korea
 
Complex event flows in distributed systems
Complex event flows in distributed systemsComplex event flows in distributed systems
Complex event flows in distributed systemsBernd Ruecker
 
What are Microservices | Microservices Architecture Training | Microservices ...
What are Microservices | Microservices Architecture Training | Microservices ...What are Microservices | Microservices Architecture Training | Microservices ...
What are Microservices | Microservices Architecture Training | Microservices ...Edureka!
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesAraf Karsh Hamid
 
Building Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache KafkaBuilding Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache KafkaGuido Schmutz
 
Infrastructure Continuous Delivery Using AWS CloudFormation
Infrastructure Continuous Delivery Using AWS CloudFormationInfrastructure Continuous Delivery Using AWS CloudFormation
Infrastructure Continuous Delivery Using AWS CloudFormationAmazon Web Services
 
Microservices
MicroservicesMicroservices
MicroservicesSmartBear
 
Apache Kafka as Event Streaming Platform for Microservice Architectures
Apache Kafka as Event Streaming Platform for Microservice ArchitecturesApache Kafka as Event Streaming Platform for Microservice Architectures
Apache Kafka as Event Streaming Platform for Microservice ArchitecturesKai Wähner
 
AWS Certification | AWS Architect Certification Training | AWS Tutorial | AWS...
AWS Certification | AWS Architect Certification Training | AWS Tutorial | AWS...AWS Certification | AWS Architect Certification Training | AWS Tutorial | AWS...
AWS Certification | AWS Architect Certification Training | AWS Tutorial | AWS...Edureka!
 
Building Distributed Applications with AWS Step Functions
Building Distributed Applications with AWS Step FunctionsBuilding Distributed Applications with AWS Step Functions
Building Distributed Applications with AWS Step FunctionsAmazon Web Services
 
AWS Community Day 2022 Dhiraj Mahapatro_AWS Lambda under the hood _ Best Prac...
AWS Community Day 2022 Dhiraj Mahapatro_AWS Lambda under the hood _ Best Prac...AWS Community Day 2022 Dhiraj Mahapatro_AWS Lambda under the hood _ Best Prac...
AWS Community Day 2022 Dhiraj Mahapatro_AWS Lambda under the hood _ Best Prac...AWS Chicago
 

What's hot (20)

Why Microservices
Why MicroservicesWhy Microservices
Why Microservices
 
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
 
Microservices Part 3 Service Mesh and Kafka
Microservices Part 3 Service Mesh and KafkaMicroservices Part 3 Service Mesh and Kafka
Microservices Part 3 Service Mesh and Kafka
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architecture
 
아키텍처 현대화 분야 신규 서비스 - 주성식, AWS 솔루션즈 아키텍트 :: AWS re:Invent re:Cap 2021
아키텍처 현대화 분야 신규 서비스 - 주성식, AWS 솔루션즈 아키텍트 :: AWS re:Invent re:Cap 2021아키텍처 현대화 분야 신규 서비스 - 주성식, AWS 솔루션즈 아키텍트 :: AWS re:Invent re:Cap 2021
아키텍처 현대화 분야 신규 서비스 - 주성식, AWS 솔루션즈 아키텍트 :: AWS re:Invent re:Cap 2021
 
Introduction to AWS Step Functions:
Introduction to AWS Step Functions: Introduction to AWS Step Functions:
Introduction to AWS Step Functions:
 
Building Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache KafkaBuilding Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache Kafka
 
Amazon Personalize Event Tracker 실시간 고객 반응을 고려한 추천::김태수, 솔루션즈 아키텍트, AWS::AWS ...
Amazon Personalize Event Tracker 실시간 고객 반응을 고려한 추천::김태수, 솔루션즈 아키텍트, AWS::AWS ...Amazon Personalize Event Tracker 실시간 고객 반응을 고려한 추천::김태수, 솔루션즈 아키텍트, AWS::AWS ...
Amazon Personalize Event Tracker 실시간 고객 반응을 고려한 추천::김태수, 솔루션즈 아키텍트, AWS::AWS ...
 
Complex event flows in distributed systems
Complex event flows in distributed systemsComplex event flows in distributed systems
Complex event flows in distributed systems
 
What are Microservices | Microservices Architecture Training | Microservices ...
What are Microservices | Microservices Architecture Training | Microservices ...What are Microservices | Microservices Architecture Training | Microservices ...
What are Microservices | Microservices Architecture Training | Microservices ...
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing Strategies
 
Building Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache KafkaBuilding Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache Kafka
 
Infrastructure Continuous Delivery Using AWS CloudFormation
Infrastructure Continuous Delivery Using AWS CloudFormationInfrastructure Continuous Delivery Using AWS CloudFormation
Infrastructure Continuous Delivery Using AWS CloudFormation
 
Microservices
MicroservicesMicroservices
Microservices
 
Apache Kafka as Event Streaming Platform for Microservice Architectures
Apache Kafka as Event Streaming Platform for Microservice ArchitecturesApache Kafka as Event Streaming Platform for Microservice Architectures
Apache Kafka as Event Streaming Platform for Microservice Architectures
 
Deep Dive: AWS CloudFormation
Deep Dive: AWS CloudFormationDeep Dive: AWS CloudFormation
Deep Dive: AWS CloudFormation
 
AWS Certification | AWS Architect Certification Training | AWS Tutorial | AWS...
AWS Certification | AWS Architect Certification Training | AWS Tutorial | AWS...AWS Certification | AWS Architect Certification Training | AWS Tutorial | AWS...
AWS Certification | AWS Architect Certification Training | AWS Tutorial | AWS...
 
Building Distributed Applications with AWS Step Functions
Building Distributed Applications with AWS Step FunctionsBuilding Distributed Applications with AWS Step Functions
Building Distributed Applications with AWS Step Functions
 
AWS Community Day 2022 Dhiraj Mahapatro_AWS Lambda under the hood _ Best Prac...
AWS Community Day 2022 Dhiraj Mahapatro_AWS Lambda under the hood _ Best Prac...AWS Community Day 2022 Dhiraj Mahapatro_AWS Lambda under the hood _ Best Prac...
AWS Community Day 2022 Dhiraj Mahapatro_AWS Lambda under the hood _ Best Prac...
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 

Similar to AxonIQCon22 - Beyond DDD 101 - Zambrovski-Galinski.pptx

Building Cloud-Native Applications in MiCADO - MiCADO webinar No.2/4 - 09/2019
Building Cloud-Native Applications in MiCADO - MiCADO webinar No.2/4 - 09/2019Building Cloud-Native Applications in MiCADO - MiCADO webinar No.2/4 - 09/2019
Building Cloud-Native Applications in MiCADO - MiCADO webinar No.2/4 - 09/2019Project COLA
 
Bridging the Instance V1 Marks and Encryptions
Bridging the Instance V1 Marks and EncryptionsBridging the Instance V1 Marks and Encryptions
Bridging the Instance V1 Marks and EncryptionsBrij Consulting, LLC
 
From desktop to the cloud with forge
From desktop to the cloud with forgeFrom desktop to the cloud with forge
From desktop to the cloud with forgefpm2015
 
Cloud Computing-10012021-v4-hosting by Rinko Kabiraj.ppt
Cloud Computing-10012021-v4-hosting by Rinko Kabiraj.pptCloud Computing-10012021-v4-hosting by Rinko Kabiraj.ppt
Cloud Computing-10012021-v4-hosting by Rinko Kabiraj.ppttanim26
 
Forge - DevCon 2016: From Desktop to the Cloud with Forge
Forge - DevCon 2016: From Desktop to the Cloud with ForgeForge - DevCon 2016: From Desktop to the Cloud with Forge
Forge - DevCon 2016: From Desktop to the Cloud with ForgeAutodesk
 
CCCNA17 Introduction
CCCNA17 IntroductionCCCNA17 Introduction
CCCNA17 IntroductionShapeBlue
 
Basics of Cloud Computing- 5 th semester
Basics of Cloud Computing- 5 th semesterBasics of Cloud Computing- 5 th semester
Basics of Cloud Computing- 5 th semestersadas88
 
Crossover Conveyance V1 Glass Path
Crossover Conveyance V1 Glass PathCrossover Conveyance V1 Glass Path
Crossover Conveyance V1 Glass PathBrij Consulting, LLC
 
TRESOR: The modular cloud - Building a domain specific cloud platform with OS...
TRESOR: The modular cloud - Building a domain specific cloud platform with OS...TRESOR: The modular cloud - Building a domain specific cloud platform with OS...
TRESOR: The modular cloud - Building a domain specific cloud platform with OS...mfrancis
 
All Streams Ahead! ksqlDB Workshop ANZ
All Streams Ahead! ksqlDB Workshop ANZAll Streams Ahead! ksqlDB Workshop ANZ
All Streams Ahead! ksqlDB Workshop ANZconfluent
 
AWS Cloud Computing workshop 30-31st May Bangalore
AWS Cloud Computing workshop 30-31st May BangaloreAWS Cloud Computing workshop 30-31st May Bangalore
AWS Cloud Computing workshop 30-31st May BangaloreSudhir Nair
 
AWS Cloud Computing workshop 30-31 May Bangalore
AWS Cloud Computing workshop 30-31 May BangaloreAWS Cloud Computing workshop 30-31 May Bangalore
AWS Cloud Computing workshop 30-31 May BangaloreBOOSTurSKILLS
 
AWS Cloud Computing workshop 30 31st May Bangalore
AWS Cloud Computing workshop 30 31st May BangaloreAWS Cloud Computing workshop 30 31st May Bangalore
AWS Cloud Computing workshop 30 31st May BangaloreSudhir Nair
 
AWS Cloud Computing workshop 30-31 May Bangalore
AWS Cloud Computing workshop 30-31 May BangaloreAWS Cloud Computing workshop 30-31 May Bangalore
AWS Cloud Computing workshop 30-31 May BangaloreSudhir Nair
 
idsecconf2023 - Neil Armstrong - Leveraging IaC for Stealthy Infrastructure A...
idsecconf2023 - Neil Armstrong - Leveraging IaC for Stealthy Infrastructure A...idsecconf2023 - Neil Armstrong - Leveraging IaC for Stealthy Infrastructure A...
idsecconf2023 - Neil Armstrong - Leveraging IaC for Stealthy Infrastructure A...idsecconf
 
code lab live Google Cloud Endpoints [DevFest 2015 Bari]
code lab live Google Cloud Endpoints [DevFest 2015 Bari]code lab live Google Cloud Endpoints [DevFest 2015 Bari]
code lab live Google Cloud Endpoints [DevFest 2015 Bari]Nicola Policoro
 
Experiments with Complex Scientific Applications on Hybrid Cloud Infrastructures
Experiments with Complex Scientific Applications on Hybrid Cloud InfrastructuresExperiments with Complex Scientific Applications on Hybrid Cloud Infrastructures
Experiments with Complex Scientific Applications on Hybrid Cloud InfrastructuresRafael Ferreira da Silva
 
Cloudstack container service
Cloudstack container serviceCloudstack container service
Cloudstack container serviceShapeBlue
 
Lightening the burden of cloud resources administration: from VMs to Functions
Lightening the burden of cloud resources administration: from VMs to FunctionsLightening the burden of cloud resources administration: from VMs to Functions
Lightening the burden of cloud resources administration: from VMs to FunctionsEUBrasilCloudFORUM .
 

Similar to AxonIQCon22 - Beyond DDD 101 - Zambrovski-Galinski.pptx (20)

Building Cloud-Native Applications in MiCADO - MiCADO webinar No.2/4 - 09/2019
Building Cloud-Native Applications in MiCADO - MiCADO webinar No.2/4 - 09/2019Building Cloud-Native Applications in MiCADO - MiCADO webinar No.2/4 - 09/2019
Building Cloud-Native Applications in MiCADO - MiCADO webinar No.2/4 - 09/2019
 
Bridging the Instance V1 Marks and Encryptions
Bridging the Instance V1 Marks and EncryptionsBridging the Instance V1 Marks and Encryptions
Bridging the Instance V1 Marks and Encryptions
 
From desktop to the cloud with forge
From desktop to the cloud with forgeFrom desktop to the cloud with forge
From desktop to the cloud with forge
 
Cloud Computing-10012021-v4-hosting by Rinko Kabiraj.ppt
Cloud Computing-10012021-v4-hosting by Rinko Kabiraj.pptCloud Computing-10012021-v4-hosting by Rinko Kabiraj.ppt
Cloud Computing-10012021-v4-hosting by Rinko Kabiraj.ppt
 
Forge - DevCon 2016: From Desktop to the Cloud with Forge
Forge - DevCon 2016: From Desktop to the Cloud with ForgeForge - DevCon 2016: From Desktop to the Cloud with Forge
Forge - DevCon 2016: From Desktop to the Cloud with Forge
 
CCCNA17 Introduction
CCCNA17 IntroductionCCCNA17 Introduction
CCCNA17 Introduction
 
Basics of Cloud Computing- 5 th semester
Basics of Cloud Computing- 5 th semesterBasics of Cloud Computing- 5 th semester
Basics of Cloud Computing- 5 th semester
 
Crossover Conveyance V1 Glass Path
Crossover Conveyance V1 Glass PathCrossover Conveyance V1 Glass Path
Crossover Conveyance V1 Glass Path
 
TRESOR: The modular cloud - Building a domain specific cloud platform with OS...
TRESOR: The modular cloud - Building a domain specific cloud platform with OS...TRESOR: The modular cloud - Building a domain specific cloud platform with OS...
TRESOR: The modular cloud - Building a domain specific cloud platform with OS...
 
All Streams Ahead! ksqlDB Workshop ANZ
All Streams Ahead! ksqlDB Workshop ANZAll Streams Ahead! ksqlDB Workshop ANZ
All Streams Ahead! ksqlDB Workshop ANZ
 
AWS Cloud Computing workshop 30-31st May Bangalore
AWS Cloud Computing workshop 30-31st May BangaloreAWS Cloud Computing workshop 30-31st May Bangalore
AWS Cloud Computing workshop 30-31st May Bangalore
 
AWS Cloud Computing workshop 30-31 May Bangalore
AWS Cloud Computing workshop 30-31 May BangaloreAWS Cloud Computing workshop 30-31 May Bangalore
AWS Cloud Computing workshop 30-31 May Bangalore
 
AWS Cloud Computing workshop 30 31st May Bangalore
AWS Cloud Computing workshop 30 31st May BangaloreAWS Cloud Computing workshop 30 31st May Bangalore
AWS Cloud Computing workshop 30 31st May Bangalore
 
AWS Cloud Computing workshop 30-31 May Bangalore
AWS Cloud Computing workshop 30-31 May BangaloreAWS Cloud Computing workshop 30-31 May Bangalore
AWS Cloud Computing workshop 30-31 May Bangalore
 
idsecconf2023 - Neil Armstrong - Leveraging IaC for Stealthy Infrastructure A...
idsecconf2023 - Neil Armstrong - Leveraging IaC for Stealthy Infrastructure A...idsecconf2023 - Neil Armstrong - Leveraging IaC for Stealthy Infrastructure A...
idsecconf2023 - Neil Armstrong - Leveraging IaC for Stealthy Infrastructure A...
 
code lab live Google Cloud Endpoints [DevFest 2015 Bari]
code lab live Google Cloud Endpoints [DevFest 2015 Bari]code lab live Google Cloud Endpoints [DevFest 2015 Bari]
code lab live Google Cloud Endpoints [DevFest 2015 Bari]
 
Experiments with Complex Scientific Applications on Hybrid Cloud Infrastructures
Experiments with Complex Scientific Applications on Hybrid Cloud InfrastructuresExperiments with Complex Scientific Applications on Hybrid Cloud Infrastructures
Experiments with Complex Scientific Applications on Hybrid Cloud Infrastructures
 
Cloudstack container service
Cloudstack container serviceCloudstack container service
Cloudstack container service
 
Best
BestBest
Best
 
Lightening the burden of cloud resources administration: from VMs to Functions
Lightening the burden of cloud resources administration: from VMs to FunctionsLightening the burden of cloud resources administration: from VMs to Functions
Lightening the burden of cloud resources administration: from VMs to Functions
 

Recently uploaded

OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...NETWAYS
 
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...henrik385807
 
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )Pooja Nehwal
 
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxNikitaBankoti2
 
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxMohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxmohammadalnahdi22
 
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Salam Al-Karadaghi
 
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStr
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStrSaaStr Workshop Wednesday w: Jason Lemkin, SaaStr
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStrsaastr
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Hasting Chen
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AITatiana Gurgel
 
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfOpen Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfhenrik385807
 
George Lever - eCommerce Day Chile 2024
George Lever -  eCommerce Day Chile 2024George Lever -  eCommerce Day Chile 2024
George Lever - eCommerce Day Chile 2024eCommerce Institute
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Vipesco
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Kayode Fayemi
 
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Pooja Nehwal
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Chameera Dedduwage
 
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024eCommerce Institute
 
Mathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMoumonDas2
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubssamaasim06
 
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝soniya singh
 

Recently uploaded (20)

OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
 
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
 
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
 
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
 
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxMohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
 
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
 
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStr
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStrSaaStr Workshop Wednesday w: Jason Lemkin, SaaStr
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStr
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AI
 
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfOpen Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
 
George Lever - eCommerce Day Chile 2024
George Lever -  eCommerce Day Chile 2024George Lever -  eCommerce Day Chile 2024
George Lever - eCommerce Day Chile 2024
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
 
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)
 
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
 
Mathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptx
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubs
 
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
 

AxonIQCon22 - Beyond DDD 101 - Zambrovski-Galinski.pptx

  • 1. Beyond DDD 101 A practice report on building multi bounded context CQRS/ES applications Jan Galinski & Simon Zambrovski Amsterdam, 23.09.2022 1
  • 2. Who we are Jan Galinski Simon Zambrovski 23.09.2022, AxonIQCon 2022 2 Consultants @ holisticon Backend developers, software architects DDD, CQRS/ES, Axon Framework, Spring, Kotlin, Java
  • 3. What is Holisticon • IT Consulting • Hamburg, Hannover, Kiel • Cool crew • Best Employer 2022 in Hamburg • We are hiring! 23.09.2022, AxonIQCon 2022 3 BESTE BERATUNG – BESTE SOFTWARE
  • 4. Motivation • We love architecture • DDD • CQRS • Event Sourcing • Large-scale applications running on JVM • We love Axon Framework • We want to share our experience 23.09.2022, AxonIQCon 2022 4 https://www.pexels.com/de-de/foto/verschiedene-puzzlespiele-1586951/
  • 5. Foundation – Theory - DDD • Set of principles for system implementation • Requirement Engineering • Domain Modeling • Strategic Design • Bounded Context identification • Context Mapping • Design • Ubiquitous Language • Design Patterns 23.09.2022, AxonIQCon 2022 5 https://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215
  • 6. Foundation – Theory – DDD Patterns • Modeling of Bounded Context relationships (for Microservices) • Separate Ways • Upstream/Downstream • Open Host Service + Published Language • Anti Corruption Layer • Tactical Design • Value Object, Entity, Aggregate, Aggregate Root • Domain Service, Factory, Repository • Domain Event • Saga Pattern 23.09.2022, AxonIQCon 2022 6
  • 7. Foundation – Theory – CQRS/ES • Command Query Responsibility Segregation Pattern • Reduce complexity of Domain model • Separate Command model from Query model (optimized) • Scale-out independently • Event Sourcing Persistence Strategy • Store Domain Events (versus store State) • Derive State from Domain Event stream • CQRS/ES • Use Domain Events to communicate between Command and Query models • Allow late stream consumption (stream replay) 23.09.2022, AxonIQCon 2022 7
  • 8. Domain Foundation - Onion Architecture Driving (primary) Adapter Driven (secondary) Adapter Domain Model Ring Port Port Application Service Ring Infrastructure Ring 23.09.2022, AxonIQCon 2022 8
  • 9. Axon Framework 101 • FOSS framework in Java for building DDD CQRS(/ES) systems • Explicit message concept • 3 buses for decoupling • Command -> Addressed intent of a change, may fail, unicast • Event -> Fact, broadcast • Query -> Request for data, has result, multicast • Domain Model Segregation (implements CQRS) • Event Sourcing implementation (different Event Stores) • Separation of business logic from configuration 23.09.2022, AxonIQCon 2022 9 https://developer.axoniq.io/download
  • 10. Possible Architecture using Axon Framework 23.09.2022, AxonIQCon 2022 10 https://docs.axoniq.io/reference-guide/
  • 11. System evolution in single context • Build components using buses for communication • Start with modulith • Distribute along buses • Scale out projections • Build new projections later • Change infrastructure 23.09.2022, AxonIQCon 2022 11
  • 12. Domain Core Onion Architecture with Axon Framework REST Adapter Query Model Command Model Command Gateway Query Gateway Projection Repository Aggregate Repository Query Bus Comma nd Bus Event Bus Pivotal Event Bus Pivotal Event Bus Domain Event Bus Domain Comma nd Bus Query Bus Saga 23.09.2022, AxonIQCon 2022 12
  • 13. 23.09.2022, AxonIQCon 2022 13 https://www.pexels.com/de-de/foto/mann-frustration-kopfschmerzen-brille-9843268/
  • 14. Domain Core Onion Architecture with Axon Framework REST Adapter Query Model Command Model Command Gateway Query Gateway Projection Repository Aggregate Repository Query Bus Comma nd Bus Event Bus Pivotal Event Bus Pivotal Event Bus Domain Event Bus Domain Comma nd Bus Query Bus Saga 23.09.2022, AxonIQCon 2022 14
  • 15. Simplified context building block Query Model Command Model Query Bus Comma nd Bus Event Bus Event Bus Comma nd Bus Query Bus Saga 23.09.2022, AxonIQCon 2022 15
  • 17. Q Master Data Query Q S D U 23.09.2022, AxonIQCon 2022 17 „You know some things that I need to know, please tell me!“ Query
  • 18. Master Data Query Q S Q D U 23.09.2022, AxonIQCon 2022 18 Query Benefits • Simple (~ GET) • No redundancy (GDPR) • Encapsulate complex business logic Challenges • Runtime dependency • Trap: Building specialized projections for other teams • Outdated data, caching
  • 19. Trigger a query C U D 23.09.2022, AxonIQCon 2022 19 Q Q „I made some changes … ask me if you want more details.“ Query C‘
  • 20. Trigger a query C U D 23.09.2022, AxonIQCon 2022 20 Q Q Query Benefits •„Cache invalidation“ Challenges •Runtime dependency* •Load (query avalanche)
  • 21. Query Aggregator C Q U D 23.09.2022, AxonIQCon 2022 21 „Here is some data that could be useful to build your projection.“ Query Q‘ C‘
  • 22. Query Aggregator C Q U D 23.09.2022, AxonIQCon 2022 22 Query Benefits • Decoupling • Build complex projections from other contexts Challenges • Event Payload definition • Payload interpretation
  • 23. Reacting to Fact C S C U D 23.09.2022, AxonIQCon 2022 23 Command „I changed some things … deal with it.“ C‘ C‘
  • 24. Reacting to Fact C S C U D 23.09.2022, AxonIQCon 2022 24 Command Benefits • Simple • Decoupled • Event Driven Challenges • Downstream Command model must follow • Command-Event-Command bridge
  • 25. Downstream Saga C S C D U 23.09.2022, AxonIQCon 2022 25 Command „I need you to do something for me, and I need the result.“ C* C‘ C‘
  • 26. Downstream Saga C S C D U 23.09.2022, AxonIQCon 2022 26 Command Benefits • Build for failure • Delegate sub processes Challenges • Compensation • Complex for more than one context
  • 27. External Orchestrator C S C D U U 23.09.2022, AxonIQCon 2022 27 Command C* C* C‘ C‘ „If you two cannot handle it, let me take control.“
  • 28. External Orchestrator C S C D U U 23.09.2022, AxonIQCon 2022 28 Command Benefits • Build for failure • Separate ways • Business process Challenges • Compensation • Complex for more than one context
  • 29. Key Takeaways • Domain Driven Design • Start with Strategic Design • Do proper Context Mapping – Relationships! • CQRS/ES • Use Command / Event / Query abstractions („Events only“ is not enough) • Use Axon Framework if working on JVM • Practical • Start with a modulith • Build evolutionary • Distribute on demand 23.09.2022, AxonIQCon 2022 29
  • 30. Thank you... Questions? • Holisticon AG • https://holisticon.de/ • Jan • https://about.me/jangalinski • Simon • https://about.me/zambrovski • Axon Framework • https://developer.axoniq.io/ 23.09.2022, AxonIQCon 2022 30 https://www.pexels.com/de-de/foto/fragezeichen-auf-zerknittertem-papier-5428826/

Editor's Notes

  1. Camunda Champions/Process Automation
  2. Context defines semantics ACL - semantical mapping Design:
  3. Command Model: validation Query Model: optimized projections
  4. ES: EventStore(s), Replay, Snapshotting, Upcasting
  5. This was a lot to swallow – DD/CQR/Oninon in 10 Minutes Reached the Plateau of maximum complexity Story of ranked Break down
  6. we only care about the external/pivotal view
  7. 2 models, a saga, 3 busses
  8. Separate ways is already a pattern not invented but recognized/discovered Introduce a model for context communication how they commincate: patterns – no true or false, combinations are possible We have 6 today, but there might be more Query Patterns Command Patterns
  9. Reporting collects customer data and account to send out letters credit manager needs balance history to calculate interest rates ...
  10. Hint: GraphQL Remote projection
  11. Event: Milestone/Trigger/Notification Runtime: not that hard Query might not return the result the event intended
  12. Event: Fat Event, contains data
  13. Do we event source fat pivotal events? next: command
  14. ACL Pure Choreography
  15. customer wants to cancel releationship account management discovers open debt and rejects if sync: command failing might be enough if async: ack/nack event
  16. pure orchestration
  17. Separate ways Complex business scenarios Process engine