SlideShare a Scribd company logo
Scaling Products:
People and Technology
What do Domain-Driven Design, Event Sourcing, and CQRS
have to do with each other?
“Who am I? Why am I here?”
– Admiral James Stockdale
Who is Jeff? Why is he here?
Data Platform Architect for HPE InfoSight
Technologist / Generalist
Work with many teams across HPE
Who are you? Why are you here?
Free beer and pizza at the Kafka Meetup!
Monolith to Microservices?
Focus shift from one component to entire solution?
Would like to migrate your DB, but you’re stuck?
Reactive, responsive, real-time insights for your customers?
Struggling with data engineering and ETL for your data warehouse?
Successful product needs to scale?
Challenges We Face
Scaling is hard! Why?
Consistency is easy for singletons (e.g. monoliths)
Tech: Service, Database, Server, Data Center
People: Team, Geography, Code Repo
Change is hard! I don’t know why, it just is.
Scaling and change are not inherent goals…just inevitable
TL;DR
Domain-Driven Design - organizing an evolving software model
in a way that harmonizes communication within the software
and among the people that develop it
Event Sourcing - organizing the publishing of a complete set of
information for an evolving set of consumers
Command Query Responsibility Segregation (CQRS)
Separate and scale transactions separately from queries
In conjunction with Event Sourcing, democratizes data
Domain-Driven Design
Domain-Driven Design
How to organize software and services based on the
objectives and actual model of the business?
Complementary with Agile methodologies
Collaboration between technical and subject matter experts
to map the business into the software
Principled approach for migration to Microservices
Learn about DDD before you (re-)architect your system
Domains and Services
Services are part of domains
Terminology: Domain has a consistent Model within a
Bounded Context, described by a Ubiquitous Language,
manifested in the software itself
Core Domain is unique and critical to the business
Sub-Domains are more generic, less important
Device
Ident &
Auth
Federated ID
Entitlement
CRM
Cases
Core Domain
Installed Base
Email
Rule
Registry
API
Gateway
Device Shadow
Health
Alerts
Data Access within Domains
Services respond to Commands and Queries
Commands can change state, cause side effects
Queries share data with no side effects
Return data from the service DB
Proxy requests to other services
Return application-level joins of the above two
Complex queries across data models?
“Microservices shall have their very own database.”
– People on the Internet
https://xkcd.com/386
“Oh, crap. My data is everywhere.”
– Microservice Adopter
“Trust me. MICRO-services are the dumbest
services in the world. Sad.”
– Microservice Hater
Event Sourcing
Event Sourcing
Event is something that has happened
Truth is represented as a time-ordered stream of events
The Log - classic blog post by Jay Kreps
Transaction logs - e.g. DB and storage replication
Views (e.g. DB tables) can be populated from event
stream
Producers and Consumers
Microservices and Streaming Jobs can both be
Producers and Consumers of Event Streams
IoT Core Domain
API Query DB
Data Warehouse
or Data Mart
Shadow Device
Aggregator Microservice
Device Shadows
Device
Streaming
Load
Streaming
Load
Stateless API
Microservice
Data Science
Kafka
Subscribe to Event Streams from other Domains
Domain-Produced
Event Stream
Config
Rule
Checking
Device
Device Shadow
Commands / Queries
Status, Metrics,
Events, Logs
Commands,
Desired State Streaming
Analytics / ML
Kafka
Device
Ident &
Auth
Federated ID
Entitlement
CRM
Cases
Core Domain
Installed Base
Email
Rule
Registry
API
Gateway
Device Shadow
Health
Alerts
Tagging
Command Query Responsibility
Segregation
(CQRS)
CQRS
Why segregate Commands and Queries?
Traditional services query the same transactional DB
Separating them allows different architectures and to
scale independently
Commands still support transactions, but Queries are
Eventually Consistent
CQRS
CQRS / Event Sourcing
Transactional Event
Sourcing
CQRS/ES only makes sense in Services with Entities that
support Commands (i.e. transactions)
Does not apply to Gateway Services (“Salesforce says…”)
Not applicable for Stream Processing Frameworks
For transactions across Services, see Saga Pattern
Questions?

More Related Content

What's hot (20)

PDF
viaExpat Global Workforce Mobility Software
radixtechnologies
 
PPTX
To Cloud Or Not To Cloud
Advanced Business Solutions
 
PPTX
Scense introduction deck
HesselWellema
 
PPT
Groupware
VJ Aiswaryadevi
 
PPTX
Citrix Mforum 2014 m104 JonathanWade
Jonathan Wade
 
PPTX
Visualizing Software Architecture Effectively in Service Description
Sanjoy Kumar Roy
 
PDF
Business and Online Services - Ben Kepes
Intergen
 
PPT
MSSU Gestalt Presentation 2007-10-25
jhoover667
 
PDF
Site Seller 2015
Josh Earnhart
 
PPT
Cloud computing and_saas
Rahul Parmar
 
PPT
Cloud computing and_saas
kavinalli
 
PPT
Via Expat Introduction
amatolcsy
 
PDF
The Software-Defined Data Center - Dell and Cumulus Networks
Cumulus Networks
 
PPT
Government Applications of Cloud Computing
Roger Smith
 
PPTX
Mobile Agent - Taking Your Show On The Road
Derec Shuler
 
PDF
Drupal presentations-badcamp-2014
Lev Tsypin
 
PDF
Why Care About UX
David Chou
 
PDF
Cloud desktop for byod
Droidcon Berlin
 
PPTX
Classrooms - Anywhere, Anytime! - Geoff Green, MCPc
Association of Independent Kentucky Colleges and Universities
 
PDF
Big Data & the Enterprise
Ben Stopford
 
viaExpat Global Workforce Mobility Software
radixtechnologies
 
To Cloud Or Not To Cloud
Advanced Business Solutions
 
Scense introduction deck
HesselWellema
 
Groupware
VJ Aiswaryadevi
 
Citrix Mforum 2014 m104 JonathanWade
Jonathan Wade
 
Visualizing Software Architecture Effectively in Service Description
Sanjoy Kumar Roy
 
Business and Online Services - Ben Kepes
Intergen
 
MSSU Gestalt Presentation 2007-10-25
jhoover667
 
Site Seller 2015
Josh Earnhart
 
Cloud computing and_saas
Rahul Parmar
 
Cloud computing and_saas
kavinalli
 
Via Expat Introduction
amatolcsy
 
The Software-Defined Data Center - Dell and Cumulus Networks
Cumulus Networks
 
Government Applications of Cloud Computing
Roger Smith
 
Mobile Agent - Taking Your Show On The Road
Derec Shuler
 
Drupal presentations-badcamp-2014
Lev Tsypin
 
Why Care About UX
David Chou
 
Cloud desktop for byod
Droidcon Berlin
 
Classrooms - Anywhere, Anytime! - Geoff Green, MCPc
Association of Independent Kentucky Colleges and Universities
 
Big Data & the Enterprise
Ben Stopford
 

Similar to Raleigh Kafka Meetup - DDD, ES, and CQRS (20)

PPTX
Microservices Architecture Part 2 Event Sourcing and Saga
Araf Karsh Hamid
 
PPTX
LevelsConf 2018 Event Sourcing - Dasith Wijesiriwardena
Dasith Wijesiriwardena
 
PPTX
Introduction to CQRS and Event Sourcing
Joe Drumgoole
 
PDF
Patterns of Distributed Application Design
GlobalLogic Ukraine
 
KEY
Event Driven Architecture
andreaskallberg
 
PDF
Developing event-driven microservices with event sourcing and CQRS (london Ja...
Chris Richardson
 
PDF
Microservice Architecuture with Event Sourcing @ Sydney JVM Meetup
Boris Kravtsov
 
PPTX
Patterns of Distributed Application Design
Orkhan Gasimov
 
PPTX
Cqrs and event sourcing in azure
Sergey Seletsky
 
PDF
Developing Event-driven Microservices with Event Sourcing & CQRS (gotoams)
Chris Richardson
 
PDF
Microservice Architecture with CQRS and Event Sourcing
Ben Wilcock
 
PPTX
Cqrs event sourcing slide landis+gyr
Atul Katiyar
 
PDF
Event Driven-Architecture from a Scalability perspective
Jonas Bonér
 
PPTX
Brown bag eventdrivenmicroservices-cqrs
Vikash Kodati
 
PDF
Developing event-driven microservices with event sourcing and CQRS (Shanghai)
Chris Richardson
 
PPTX
Design | expose ap is with cqr
Jabar Asadi
 
PPTX
Design | expose ap is with cqrs
elazhiA
 
PDF
CQRS + Event Sourcing
Mike Bild
 
PDF
SVCC Developing Asynchronous, Message-Driven Microservices
Chris Richardson
 
PDF
Handling Eventual Consistency in JVM Microservices with Event Sourcing (javao...
Chris Richardson
 
Microservices Architecture Part 2 Event Sourcing and Saga
Araf Karsh Hamid
 
LevelsConf 2018 Event Sourcing - Dasith Wijesiriwardena
Dasith Wijesiriwardena
 
Introduction to CQRS and Event Sourcing
Joe Drumgoole
 
Patterns of Distributed Application Design
GlobalLogic Ukraine
 
Event Driven Architecture
andreaskallberg
 
Developing event-driven microservices with event sourcing and CQRS (london Ja...
Chris Richardson
 
Microservice Architecuture with Event Sourcing @ Sydney JVM Meetup
Boris Kravtsov
 
Patterns of Distributed Application Design
Orkhan Gasimov
 
Cqrs and event sourcing in azure
Sergey Seletsky
 
Developing Event-driven Microservices with Event Sourcing & CQRS (gotoams)
Chris Richardson
 
Microservice Architecture with CQRS and Event Sourcing
Ben Wilcock
 
Cqrs event sourcing slide landis+gyr
Atul Katiyar
 
Event Driven-Architecture from a Scalability perspective
Jonas Bonér
 
Brown bag eventdrivenmicroservices-cqrs
Vikash Kodati
 
Developing event-driven microservices with event sourcing and CQRS (Shanghai)
Chris Richardson
 
Design | expose ap is with cqr
Jabar Asadi
 
Design | expose ap is with cqrs
elazhiA
 
CQRS + Event Sourcing
Mike Bild
 
SVCC Developing Asynchronous, Message-Driven Microservices
Chris Richardson
 
Handling Eventual Consistency in JVM Microservices with Event Sourcing (javao...
Chris Richardson
 
Ad

Recently uploaded (20)

PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
introduction to computer hardware and sofeware
chauhanshraddha2007
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
PDF
NewMind AI Weekly Chronicles – July’25, Week III
NewMind AI
 
PPTX
AVL ( audio, visuals or led ), technology.
Rajeshwri Panchal
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PDF
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
introduction to computer hardware and sofeware
chauhanshraddha2007
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
NewMind AI Weekly Chronicles – July’25, Week III
NewMind AI
 
AVL ( audio, visuals or led ), technology.
Rajeshwri Panchal
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
Ad

Raleigh Kafka Meetup - DDD, ES, and CQRS

  • 1. Scaling Products: People and Technology What do Domain-Driven Design, Event Sourcing, and CQRS have to do with each other?
  • 2. “Who am I? Why am I here?” – Admiral James Stockdale
  • 3. Who is Jeff? Why is he here? Data Platform Architect for HPE InfoSight Technologist / Generalist Work with many teams across HPE
  • 4. Who are you? Why are you here? Free beer and pizza at the Kafka Meetup! Monolith to Microservices? Focus shift from one component to entire solution? Would like to migrate your DB, but you’re stuck? Reactive, responsive, real-time insights for your customers? Struggling with data engineering and ETL for your data warehouse? Successful product needs to scale?
  • 5. Challenges We Face Scaling is hard! Why? Consistency is easy for singletons (e.g. monoliths) Tech: Service, Database, Server, Data Center People: Team, Geography, Code Repo Change is hard! I don’t know why, it just is. Scaling and change are not inherent goals…just inevitable
  • 6. TL;DR Domain-Driven Design - organizing an evolving software model in a way that harmonizes communication within the software and among the people that develop it Event Sourcing - organizing the publishing of a complete set of information for an evolving set of consumers Command Query Responsibility Segregation (CQRS) Separate and scale transactions separately from queries In conjunction with Event Sourcing, democratizes data
  • 8. Domain-Driven Design How to organize software and services based on the objectives and actual model of the business? Complementary with Agile methodologies Collaboration between technical and subject matter experts to map the business into the software Principled approach for migration to Microservices Learn about DDD before you (re-)architect your system
  • 9. Domains and Services Services are part of domains Terminology: Domain has a consistent Model within a Bounded Context, described by a Ubiquitous Language, manifested in the software itself Core Domain is unique and critical to the business Sub-Domains are more generic, less important
  • 10. Device Ident & Auth Federated ID Entitlement CRM Cases Core Domain Installed Base Email Rule Registry API Gateway Device Shadow Health Alerts
  • 11. Data Access within Domains Services respond to Commands and Queries Commands can change state, cause side effects Queries share data with no side effects Return data from the service DB Proxy requests to other services Return application-level joins of the above two Complex queries across data models?
  • 12. “Microservices shall have their very own database.” – People on the Internet https://xkcd.com/386
  • 13. “Oh, crap. My data is everywhere.” – Microservice Adopter
  • 14. “Trust me. MICRO-services are the dumbest services in the world. Sad.” – Microservice Hater
  • 16. Event Sourcing Event is something that has happened Truth is represented as a time-ordered stream of events The Log - classic blog post by Jay Kreps Transaction logs - e.g. DB and storage replication Views (e.g. DB tables) can be populated from event stream
  • 17. Producers and Consumers Microservices and Streaming Jobs can both be Producers and Consumers of Event Streams
  • 18. IoT Core Domain API Query DB Data Warehouse or Data Mart Shadow Device Aggregator Microservice Device Shadows Device Streaming Load Streaming Load Stateless API Microservice Data Science Kafka Subscribe to Event Streams from other Domains Domain-Produced Event Stream Config Rule Checking Device Device Shadow Commands / Queries Status, Metrics, Events, Logs Commands, Desired State Streaming Analytics / ML
  • 19. Kafka Device Ident & Auth Federated ID Entitlement CRM Cases Core Domain Installed Base Email Rule Registry API Gateway Device Shadow Health Alerts Tagging
  • 21. CQRS Why segregate Commands and Queries? Traditional services query the same transactional DB Separating them allows different architectures and to scale independently Commands still support transactions, but Queries are Eventually Consistent
  • 22. CQRS
  • 23. CQRS / Event Sourcing
  • 24. Transactional Event Sourcing CQRS/ES only makes sense in Services with Entities that support Commands (i.e. transactions) Does not apply to Gateway Services (“Salesforce says…”) Not applicable for Stream Processing Frameworks For transactions across Services, see Saga Pattern