SlideShare a Scribd company logo
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

Event driven microservices with axon and spring boot-excitingly boring
Event driven microservices with axon and spring boot-excitingly boringEvent driven microservices with axon and spring boot-excitingly boring
Event driven microservices with axon and spring boot-excitingly boring
Allard Buijze
 
Apigee Demo: API Platform Overview
Apigee Demo: API Platform OverviewApigee Demo: API Platform Overview
Apigee Demo: API Platform Overview
Apigee | Google Cloud
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
Araf Karsh Hamid
 
CQRS and Event Sourcing, An Alternative Architecture for DDD
CQRS and Event Sourcing, An Alternative Architecture for DDDCQRS and Event Sourcing, An Alternative Architecture for DDD
CQRS and Event Sourcing, An Alternative Architecture for DDD
Dennis Doomen
 
Microservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and SagaMicroservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and Saga
Araf Karsh Hamid
 
MongoDB Atlas
MongoDB AtlasMongoDB Atlas
MongoDB Atlas
MongoDB
 
워크로드 특성에 따른 안전하고 효율적인 Data Lake 운영 방안
워크로드 특성에 따른 안전하고 효율적인 Data Lake 운영 방안워크로드 특성에 따른 안전하고 효율적인 Data Lake 운영 방안
워크로드 특성에 따른 안전하고 효율적인 Data Lake 운영 방안
Amazon Web Services Korea
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architecture
The Software House
 
MongoDB Schema Design (Event: An Evening with MongoDB Houston 3/11/15)
MongoDB Schema Design (Event: An Evening with MongoDB Houston 3/11/15)MongoDB Schema Design (Event: An Evening with MongoDB Houston 3/11/15)
MongoDB Schema Design (Event: An Evening with MongoDB Houston 3/11/15)
MongoDB
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
Amazon Web Services
 
Introducing Saga Pattern in Microservices with Spring Statemachine
Introducing Saga Pattern in Microservices with Spring StatemachineIntroducing Saga Pattern in Microservices with Spring Statemachine
Introducing Saga Pattern in Microservices with Spring Statemachine
VMware Tanzu
 
Heterogenous Migration with DMS & SCT
Heterogenous Migration with DMS & SCTHeterogenous Migration with DMS & SCT
Heterogenous Migration with DMS & SCT
Amazon Web Services
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
Young-Ho Cho
 
Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven Design
Andriy Buday
 
Building Event-driven Architectures with Amazon EventBridge
Building Event-driven Architectures with Amazon EventBridge Building Event-driven Architectures with Amazon EventBridge
Building Event-driven Architectures with Amazon EventBridge
James Beswick
 
Introducing Dapr.io - the open source personal assistant to microservices and...
Introducing Dapr.io - the open source personal assistant to microservices and...Introducing Dapr.io - the open source personal assistant to microservices and...
Introducing Dapr.io - the open source personal assistant to microservices and...
Lucas Jellema
 
Introduction to AWS Organizations
Introduction to AWS OrganizationsIntroduction to AWS Organizations
Introduction to AWS Organizations
Amazon Web Services
 
Developing event-driven microservices with event sourcing and CQRS (svcc, sv...
Developing event-driven microservices with event sourcing and CQRS  (svcc, sv...Developing event-driven microservices with event sourcing and CQRS  (svcc, sv...
Developing event-driven microservices with event sourcing and CQRS (svcc, sv...
Chris Richardson
 
Introducing MongoDB Atlas
Introducing MongoDB AtlasIntroducing MongoDB Atlas
Introducing MongoDB Atlas
MongoDB
 
The Zen of DataOps – AWS Lake Formation and the Data Supply Chain Pipeline
The Zen of DataOps – AWS Lake Formation and the Data Supply Chain PipelineThe Zen of DataOps – AWS Lake Formation and the Data Supply Chain Pipeline
The Zen of DataOps – AWS Lake Formation and the Data Supply Chain Pipeline
Amazon Web Services
 

What's hot (20)

Event driven microservices with axon and spring boot-excitingly boring
Event driven microservices with axon and spring boot-excitingly boringEvent driven microservices with axon and spring boot-excitingly boring
Event driven microservices with axon and spring boot-excitingly boring
 
Apigee Demo: API Platform Overview
Apigee Demo: API Platform OverviewApigee Demo: API Platform Overview
Apigee Demo: API Platform Overview
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
CQRS and Event Sourcing, An Alternative Architecture for DDD
CQRS and Event Sourcing, An Alternative Architecture for DDDCQRS and Event Sourcing, An Alternative Architecture for DDD
CQRS and Event Sourcing, An Alternative Architecture for DDD
 
Microservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and SagaMicroservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and Saga
 
MongoDB Atlas
MongoDB AtlasMongoDB Atlas
MongoDB Atlas
 
워크로드 특성에 따른 안전하고 효율적인 Data Lake 운영 방안
워크로드 특성에 따른 안전하고 효율적인 Data Lake 운영 방안워크로드 특성에 따른 안전하고 효율적인 Data Lake 운영 방안
워크로드 특성에 따른 안전하고 효율적인 Data Lake 운영 방안
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architecture
 
MongoDB Schema Design (Event: An Evening with MongoDB Houston 3/11/15)
MongoDB Schema Design (Event: An Evening with MongoDB Houston 3/11/15)MongoDB Schema Design (Event: An Evening with MongoDB Houston 3/11/15)
MongoDB Schema Design (Event: An Evening with MongoDB Houston 3/11/15)
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
 
Introducing Saga Pattern in Microservices with Spring Statemachine
Introducing Saga Pattern in Microservices with Spring StatemachineIntroducing Saga Pattern in Microservices with Spring Statemachine
Introducing Saga Pattern in Microservices with Spring Statemachine
 
Heterogenous Migration with DMS & SCT
Heterogenous Migration with DMS & SCTHeterogenous Migration with DMS & SCT
Heterogenous Migration with DMS & SCT
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven Design
 
Building Event-driven Architectures with Amazon EventBridge
Building Event-driven Architectures with Amazon EventBridge Building Event-driven Architectures with Amazon EventBridge
Building Event-driven Architectures with Amazon EventBridge
 
Introducing Dapr.io - the open source personal assistant to microservices and...
Introducing Dapr.io - the open source personal assistant to microservices and...Introducing Dapr.io - the open source personal assistant to microservices and...
Introducing Dapr.io - the open source personal assistant to microservices and...
 
Introduction to AWS Organizations
Introduction to AWS OrganizationsIntroduction to AWS Organizations
Introduction to AWS Organizations
 
Developing event-driven microservices with event sourcing and CQRS (svcc, sv...
Developing event-driven microservices with event sourcing and CQRS  (svcc, sv...Developing event-driven microservices with event sourcing and CQRS  (svcc, sv...
Developing event-driven microservices with event sourcing and CQRS (svcc, sv...
 
Introducing MongoDB Atlas
Introducing MongoDB AtlasIntroducing MongoDB Atlas
Introducing MongoDB Atlas
 
The Zen of DataOps – AWS Lake Formation and the Data Supply Chain Pipeline
The Zen of DataOps – AWS Lake Formation and the Data Supply Chain PipelineThe Zen of DataOps – AWS Lake Formation and the Data Supply Chain Pipeline
The Zen of DataOps – AWS Lake Formation and the Data Supply Chain Pipeline
 

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/2019
Project 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 Encryptions
Brij 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 forge
fpm2015
 
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
tanim26
 
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
Autodesk
 
CCCNA17 Introduction
CCCNA17 IntroductionCCCNA17 Introduction
CCCNA17 Introduction
ShapeBlue
 
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
sadas88
 
Crossover Conveyance V1 Glass Path
Crossover Conveyance V1 Glass PathCrossover Conveyance V1 Glass Path
Crossover Conveyance V1 Glass Path
Brij 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 ANZ
confluent
 
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
Sudhir Nair
 
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
Sudhir 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 Bangalore
Sudhir 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 Bangalore
BOOSTurSKILLS
 
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 Infrastructures
Rafael Ferreira da Silva
 
Cloudstack container service
Cloudstack container serviceCloudstack container service
Cloudstack container service
ShapeBlue
 
Best
BestBest
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
EUBrasilCloudFORUM .
 

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 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-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

Bitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXOBitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXO
Matjaž Lipuš
 
Acorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutesAcorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutes
IP ServerOne
 
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
OECD Directorate for Financial and Enterprise Affairs
 
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
0x01 - Newton's Third Law:  Static vs. Dynamic Abusers0x01 - Newton's Third Law:  Static vs. Dynamic Abusers
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
OWASP Beja
 
AWANG ANIQKMALBIN AWANG TAJUDIN B22080004 ASSIGNMENT 2 MPU3193 PHILOSOPHY AND...
AWANG ANIQKMALBIN AWANG TAJUDIN B22080004 ASSIGNMENT 2 MPU3193 PHILOSOPHY AND...AWANG ANIQKMALBIN AWANG TAJUDIN B22080004 ASSIGNMENT 2 MPU3193 PHILOSOPHY AND...
AWANG ANIQKMALBIN AWANG TAJUDIN B22080004 ASSIGNMENT 2 MPU3193 PHILOSOPHY AND...
AwangAniqkmals
 
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdfSupercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Access Innovations, Inc.
 
International Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software TestingInternational Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software Testing
Sebastiano Panichella
 
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptxsomanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
Howard Spence
 
Burning Issue Presentation By Kenmaryon.pdf
Burning Issue Presentation By Kenmaryon.pdfBurning Issue Presentation By Kenmaryon.pdf
Burning Issue Presentation By Kenmaryon.pdf
kkirkland2
 
Getting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control TowerGetting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control Tower
Vladimir Samoylov
 
María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024
eCommerce Institute
 
Obesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditionsObesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditions
Faculty of Medicine And Health Sciences
 
Tom tresser burning issue.pptx My Burning issue
Tom tresser burning issue.pptx My Burning issueTom tresser burning issue.pptx My Burning issue
Tom tresser burning issue.pptx My Burning issue
amekonnen
 
Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...
Sebastiano Panichella
 
Gregory Harris' Civics Presentation.pptx
Gregory Harris' Civics Presentation.pptxGregory Harris' Civics Presentation.pptx
Gregory Harris' Civics Presentation.pptx
gharris9
 
Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024
Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024
Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024
Dutch Power
 
Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024
Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024
Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024
Dutch Power
 
Media as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern EraMedia as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern Era
faizulhassanfaiz1670
 
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Sebastiano Panichella
 
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdfBonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
khadija278284
 

Recently uploaded (20)

Bitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXOBitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXO
 
Acorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutesAcorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutes
 
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
 
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
0x01 - Newton's Third Law:  Static vs. Dynamic Abusers0x01 - Newton's Third Law:  Static vs. Dynamic Abusers
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
 
AWANG ANIQKMALBIN AWANG TAJUDIN B22080004 ASSIGNMENT 2 MPU3193 PHILOSOPHY AND...
AWANG ANIQKMALBIN AWANG TAJUDIN B22080004 ASSIGNMENT 2 MPU3193 PHILOSOPHY AND...AWANG ANIQKMALBIN AWANG TAJUDIN B22080004 ASSIGNMENT 2 MPU3193 PHILOSOPHY AND...
AWANG ANIQKMALBIN AWANG TAJUDIN B22080004 ASSIGNMENT 2 MPU3193 PHILOSOPHY AND...
 
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdfSupercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
 
International Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software TestingInternational Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software Testing
 
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptxsomanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
 
Burning Issue Presentation By Kenmaryon.pdf
Burning Issue Presentation By Kenmaryon.pdfBurning Issue Presentation By Kenmaryon.pdf
Burning Issue Presentation By Kenmaryon.pdf
 
Getting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control TowerGetting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control Tower
 
María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024
 
Obesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditionsObesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditions
 
Tom tresser burning issue.pptx My Burning issue
Tom tresser burning issue.pptx My Burning issueTom tresser burning issue.pptx My Burning issue
Tom tresser burning issue.pptx My Burning issue
 
Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...
 
Gregory Harris' Civics Presentation.pptx
Gregory Harris' Civics Presentation.pptxGregory Harris' Civics Presentation.pptx
Gregory Harris' Civics Presentation.pptx
 
Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024
Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024
Presentatie 8. Joost van der Linde & Daniel Anderton - Eliq 28 mei 2024
 
Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024
Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024
Presentatie 4. Jochen Cremer - TU Delft 28 mei 2024
 
Media as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern EraMedia as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern Era
 
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
 
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdfBonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
 

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