SlideShare a Scribd company logo
D o u b l e - c l i c k t o e d i t
CQRS & EVENT SOURCING
A DEVOPS PERSPECTIVE
Stacey Watro @_w_stacey
Maria Gomez @mariascandella
CQRS and Event Sourcing: A DevOps perspective
3
WHAT IS THIS TALK ABOUT?
WHAT IS THIS TALK ABOUT?
Dev-Ops Culture
Challenges with CQRS and Event Sourcing Systems
Deployment Monitoring
DebuggingLogging
WHAT IS THIS TALK NOT ABOUT?
WHAT IS THIS TALK NOT ABOUT?
Pros & Cons of CQRS and Event Sourcing
When to use CQRS and Event Sourcing?
LET ME TELL YOU ABOUT THIS PROJECT
LET ME TELL YOU ABOUT THIS PROJECT
20M+ accounts
Bunch of monoliths
Unscalable architecture
Snowflake servers
The old world
LET ME TELL YOU ABOUT THIS PROJECT
The new world
LET ME TELL YOU ABOUT THIS PROJECT
The new world
Scalable
Resilient
Extensible
Automated
Auditable
CQRS and Event Sourcing: A DevOps perspective
Client 1 …. Client N
Client 1 …. Client N
Mainframe
1
Mainframe
n
….
Client 1 …. Client N
Third
party 1
Third
party N
….
Mainframe
1
Mainframe
n
….
Client 1 …. Client N
Third
party 1
Third
party N
….
Mainframe
1
Mainframe
n
….
Platform
Domain1 …
Domain1
Domain1
Domain1
Domain1
Domain2
Domain1
Domain1
DomainN
Client 1 …. Client N
Third
party 1
Third
party N
….
Mainframe
1
Mainframe
n
….
Platform
Domain1 …
Domain1
Domain1
Domain1
Domain1
Domain2
Domain1
Domain1
DomainN
DEFINITIONS
DEFINITIONS
“Event Sourcing ensures that all
changes to application state are
stored as a sequence of events. Not
just can we query these events, we
can also use the event log to
reconstruct past states, and as a
foundation to automatically adjust the
state to cope with retroactive
changes.”
Martin Fowler
EVENT SOURCING
Command and Query
Responsibility Segregation (CQRS)
is a pattern that segregates the
operations that read data (queries)
from the operations that update
data (commands)
CQRS
CQRS
Command
Query
Write Event
Store
Read
Store
Read
EVENT SOURCING
$122.22
$50.04
$294.37
$33.12
$68.91
$100.02
= $668.68f(x)
}- $300.37
$300.37
…
…
Domain1
Domain1
Domain1
Domain1
Domain1
Domain2
Write
Read
Domain
DEVOPS CULTURE
Image Source: https://martinfowler.com/bliki/DevOpsCulture.html
Deployment Monitoring
DebuggingLogging
MEET THE TEAM
HOW DO WE PUT THE PLATFORM INTO PRODUCTION?
Client 1 …. Client N
Third
party 1
Third
party N
….
Mainframe
1
Mainframe
n
….
Platform
Domain1 …
Domain1
Domain1
Domain1
Domain1
Domain2
Domain1
Domain1
DomainN
REQUIREMENTS FOR DEPLOYMENTS
Zero Downtime
Safe & Repeatable
Eliminate Event Lose
Blue
Blue
Blue Green
Blue Green
Green
Domain1 ….
Domain1
Domain1
Domain1
Domain1
Domain2
Domain1
Domain1
DomainN
Domain1 ….
Domain1
Domain1
Domain1
Domain1
Domain2
Domain1
Domain1
DomainN
Event Bus
Blue Green
Event Bus Event Bus
Blue Green
Event Bus Event Bus
Blue Green
Event Bus Event Bus
Blue Green
Event Bus Event Bus
Blue Green
Event Bus Event Bus
Green
Event Bus
Blue Green
Event Bus Event Bus
Blue Green
Event Bus Event Bus
CD TO THE RESCUE
Build
Unit Tests
Deploy
Integration Tests
CD TO THE RESCUE
Build
Unit Tests
Deploy
Integration Tests
DB migrations from new code
Deploy production code
Smoke tests
CD TO THE RESCUE
DB migrations from new
Deploy production code
Smoke tests
CD TO THE RESCUE
DB migrations from new
Deploy production code
Smoke tests
CODE IN PRODUCTION!
WHAT HAPPENS WHEN SOMETHING GOES WRONG?
Client 1 …. Client N
Third
party 1
Third
party N
….
Mainframe
1
Mainframe
n
….
Platform
Domain1 …
Domain1
Domain1
Domain1
Domain1
Domain2
Domain1
Domain1
DomainN
WHAT HAPPENS WHEN SOMETHING GOES WRONG?
Client 1 …. Client N
Third
party 1
Third
party N
….
Mainframe
1
Mainframe
n
….
Platform
Domain1 …
Domain1
Domain1
Domain1
Domain1
Domain2
Domain1
Domain1
DomainN
STARTS WITH LOGGING
REQUIREMENTS
Just enough
Consistency
Usability
WHAT IS DIFFERENT ABOUT LOGGING FOR CQRS & EVENT SOURCING?
…
…
…
Domain1
Domain1
Domain1
Domain1
Domain1
Domain2
Write
Read
Domain
WHAT SHOULD YOU LOG?
WHAT SHOULD YOU LOG?
WHY IS NAMING SO IMPORTANT?
…
…
…
}{name: Stacey Watro
skill: awesome
CustomerSkillAddedEvent
CONSISTENCY IS ALSO IMPORTANT
}{name: Stacey Watro
skill: awesome
CustomerSkillAddedEvent
}{line1: 660 56th st
zipcode: 10019
AddressModifiedEvent
ITERATIVE APPROACH
HOW DO WE KNOW WHEN PROBLEMS OCCUR IN THE SYSTEM?
REQUIREMENTS
Information at a glance
Dynamic
Usability
CQRS and Event Sourcing: A DevOps perspective
What to monitor?
EXAMPLE
EXAMPLE
EXAMPLE
Online marketplace
EXAMPLE
Online marketplace
3M+ articles
10M+ users per month
EXAMPLE
Service
EXAMPLE
Data Stream A
Service
EXAMPLE
Data Stream A
ServiceDB
EXAMPLE
Data Stream A
ServiceDB
EXAMPLE
Data Stream A
Data Stream B
ServiceDB
EXAMPLE
Service
Data Stream A
Data Stream B
DB
EXAMPLE
Service
EXAMPLE
Service
/health {
“app” : “ok”
}
EXAMPLE
Service
/health {
“app” : “ok”,
“database” : “ok”
}
DB
EXAMPLE
Service
/health
{
“app” : “ok”,
“database” : “ok”,
“dataStreamA” : “ok”,
“dataStreamB” : ”ok”
}
DB
Data Stream A
Data Stream B
EXAMPLE
Service
/health
{
“app” : “ok”,
“database” : “down”,
“dataStreamA” : “ok”,
“dataStreamB” : ”ok”
}
DB
Data Stream A
Data Stream B
CQRS and Event Sourcing: A DevOps perspective
CQRS and Event Sourcing: A DevOps perspective
METRICS
METRICS
METRICS
METRICS
SYNTHETIC MONITORING
https://martinfowler.com/bliki/SyntheticMonitoring.html
SYNTHETIC MONITORING
https://martinfowler.com/bliki/SyntheticMonitoring.html
Staging
SYNTHETIC MONITORING
https://martinfowler.com/bliki/SyntheticMonitoring.html
Production
CQRS and Event Sourcing: A DevOps perspective
HOW DO WE DEBUG PROBLEMS?
REQUIREMENTS
Find problems quickly
Origin of the Request
Usability
ABILITY TO FIND THE ORIGIN OF A REQUEST
Client 1 …. Client N
Third
party 1
Third
party N
Mainframe
1
Mainframe
N
….
Platform
Domain1 …
Domain1
Domain1
Domain1
Domain1
Domain2
Domain1
Domain1
DomainN ….
ABILITY TO FIND THE ORIGIN OF A REQUEST
Client 1 …. Client N
Third
party 1
Third
party N
Mainframe
1
Mainframe
N
….
Platform
Domain1 …
Domain1
Domain1
Domain1
Domain1
Domain2
Domain1
Domain1
DomainN ….
ABILITY TO FIND THE ORIGIN OF A REQUEST
Client 1 …. Client N
Third
party 1
Third
party N
….
Mainframe
1
Mainframe
N
….
Platform
Domain1 …
Domain1
Domain1
Domain1
Domain1
Domain2
Domain1
Domain1
DomainN
ABILITY TO FIND THE ORIGIN OF A REQUEST
Client 1 …. Client N
Third
party 1
Third
party N
….
Mainframe
1
Mainframe
N
….
Platform
Domain1 …
Domain1
Domain1
Domain1
Domain1
Domain2
Domain1
Domain1
DomainN
TraceID
TraceID
TraceID
TraceID
TraceID
LOG AGGREGATOR
LOG AGGREGATOR
LOG AGGREGATOR
LOG AGGREGATOR
LOG AGGREGATOR
DISTRIBUTING TRACING
HAPPY TEAM
KEY LEARNINGS
CQRS & Event Sourcing heavily influenced the deployment, logging,
monitoring & debugging of this system
Blue/Green was best given our constraints
Log aggregation was not enough for us. Also needed monitoring
and distributed tracing.
Invest in making the system resilient and the tools accessible
For questions or suggestions:
swatro@stridenyc.com
mgomez@thoughtworks.com
THANK YOU

More Related Content

PDF
Telling the LivePerson Technology Story at Couchbase [SF] 2013
PDF
Keynote: Jay Kreps, Confluent | Kafka ♥ Cloud | Kafka Summit 2020
PDF
Kafka Summit NYC 2017 - The Real-time Event Driven Bank: A Kafka Story
PDF
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
PDF
Kafka Summit SF 2017 - Providing Reliability Guarantees in Kafka at One Trill...
PDF
How to Define and Share your Event APIs using AsyncAPI and Event API Products...
PDF
Live Coding a KSQL Application
PDF
Observability for developer ( Inny So & Andrew Jones, ThoughtWorks) Kafka Su...
Telling the LivePerson Technology Story at Couchbase [SF] 2013
Keynote: Jay Kreps, Confluent | Kafka ♥ Cloud | Kafka Summit 2020
Kafka Summit NYC 2017 - The Real-time Event Driven Bank: A Kafka Story
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
Kafka Summit SF 2017 - Providing Reliability Guarantees in Kafka at One Trill...
How to Define and Share your Event APIs using AsyncAPI and Event API Products...
Live Coding a KSQL Application
Observability for developer ( Inny So & Andrew Jones, ThoughtWorks) Kafka Su...

What's hot (20)

PPTX
Server Sent Events using Reactive Kafka and Spring Web flux | Gagan Solur Ven...
PDF
Testing Event Driven Architectures: How to Broker the Complexity | Frank Kilc...
PPTX
Data Streaming with Apache Kafka & MongoDB
PDF
Death of the dumb pipes: Using Apache Kafka® for Integration projects
PDF
Hybrid Kafka, Taking Real-time Analytics to the Business (Cody Irwin, Google ...
PDF
Risk Management in Retail with Stream Processing
PDF
Why Distributed Tracing is Essential for Performance and Reliability
PPTX
Jay Kreps, Confluent | Kafka Summit SF 2019 Keynote ft. Dev Tagare, Lyft + Pr...
PDF
dotScale 2017 Keynote: The Rise of Real Time by Neha Narkhede
PPT
Kafka Summit NYC 2017 - Simplifying Omni-Channel Retail at Scale
PDF
You Must Construct Additional Pipelines: Pub-Sub on Kafka at Blizzard
PDF
Should we manage events like APIs? | Alan Chatt and Kim Clark, IBM
PPTX
Advanced Change Data Streaming Patterns in Distributed Systems | Gunnar Morli...
PDF
Why Kafka Works the Way It Does (And Not Some Other Way) | Tim Berglund, Conf...
PDF
Leveraging Mainframe Data for Modern Analytics
PPTX
One Azure Monitor to Rule Them All? (IT Camp 2017, Cluj, RO)
PPTX
INTRODUCING: CREATE PIPELINE
PDF
Blockchain and Kafka - A Modern Love Story | Suhavi Sandhu, Guidewire Software
PDF
Sub-Second SQL Search, Aggregations and Joins with Kafka and Rockset | Dhruba...
PDF
Maximize the Business Value of Machine Learning and Data Science with Kafka (...
Server Sent Events using Reactive Kafka and Spring Web flux | Gagan Solur Ven...
Testing Event Driven Architectures: How to Broker the Complexity | Frank Kilc...
Data Streaming with Apache Kafka & MongoDB
Death of the dumb pipes: Using Apache Kafka® for Integration projects
Hybrid Kafka, Taking Real-time Analytics to the Business (Cody Irwin, Google ...
Risk Management in Retail with Stream Processing
Why Distributed Tracing is Essential for Performance and Reliability
Jay Kreps, Confluent | Kafka Summit SF 2019 Keynote ft. Dev Tagare, Lyft + Pr...
dotScale 2017 Keynote: The Rise of Real Time by Neha Narkhede
Kafka Summit NYC 2017 - Simplifying Omni-Channel Retail at Scale
You Must Construct Additional Pipelines: Pub-Sub on Kafka at Blizzard
Should we manage events like APIs? | Alan Chatt and Kim Clark, IBM
Advanced Change Data Streaming Patterns in Distributed Systems | Gunnar Morli...
Why Kafka Works the Way It Does (And Not Some Other Way) | Tim Berglund, Conf...
Leveraging Mainframe Data for Modern Analytics
One Azure Monitor to Rule Them All? (IT Camp 2017, Cluj, RO)
INTRODUCING: CREATE PIPELINE
Blockchain and Kafka - A Modern Love Story | Suhavi Sandhu, Guidewire Software
Sub-Second SQL Search, Aggregations and Joins with Kafka and Rockset | Dhruba...
Maximize the Business Value of Machine Learning and Data Science with Kafka (...
Ad

Similar to CQRS and Event Sourcing: A DevOps perspective (20)

PPTX
Introduction to CQRS and Event Sourcing
PPTX
LevelsConf 2018 Event Sourcing - Dasith Wijesiriwardena
PDF
CQRS + Event Sourcing
PPT
PPT
PPTX
Cqrs and Event Sourcing Intro For Developers
PPTX
Cqrs event sourcing slide landis+gyr
PDF
fram^ TechTalk #1 - CQRS and Event Sourcing (ES)
PDF
Unite 2017 - CQRS - Jens Gheerardyn
PDF
Microservice Architecture with CQRS and Event Sourcing
PDF
Developing event-driven microservices with event sourcing and CQRS (Shanghai)
PPTX
Cqrs and event sourcing in azure
PPTX
Intro to event sourcing and CQRS
PPTX
Real World Event Sourcing and CQRS
PPTX
CQRS
PDF
Developing event-driven microservices with event sourcing and CQRS (london Ja...
PDF
An Introduction to event sourcing and CQRS
PDF
A visual introduction to Event Sourcing and CQRS
PDF
A Visual Introduction to Event Sourcing and CQRS by Lorenzo Nicora
PPTX
Introduction to CQRS and Event Sourcing
LevelsConf 2018 Event Sourcing - Dasith Wijesiriwardena
CQRS + Event Sourcing
Cqrs and Event Sourcing Intro For Developers
Cqrs event sourcing slide landis+gyr
fram^ TechTalk #1 - CQRS and Event Sourcing (ES)
Unite 2017 - CQRS - Jens Gheerardyn
Microservice Architecture with CQRS and Event Sourcing
Developing event-driven microservices with event sourcing and CQRS (Shanghai)
Cqrs and event sourcing in azure
Intro to event sourcing and CQRS
Real World Event Sourcing and CQRS
CQRS
Developing event-driven microservices with event sourcing and CQRS (london Ja...
An Introduction to event sourcing and CQRS
A visual introduction to Event Sourcing and CQRS
A Visual Introduction to Event Sourcing and CQRS by Lorenzo Nicora
Ad

More from Maria Gomez (20)

PPTX
From Monolith to Observable Microservices using DDD
PDF
Splitting the monolith using Domain Driven Design
PDF
Observable Microservices (O'Reilly SACon London 2018)
PPTX
Effective team onboarding
PDF
Observable microservices (O'Reilly SACon NY 2018)
PDF
Security in agile teams
PDF
Security in agile teams
PDF
Observable Microservices
PDF
Splitting the Monolith
PDF
Taller de Refactorización (Campus Party Quito 2014)
PDF
Refactoring workshop (Campus Party Quito 2014)
PDF
Project Management - Report
PDF
Principles of New Media - Essay
PDF
Project Management - Risk management
PPTX
Responsive Environments - MoodMixer Presentation
PDF
Responsive Environments - Critical report
PDF
New Media Management - Gantt chart
PDF
New Media Management - Project plan
PPTX
New Media Management - Presentation
PDF
New Media Management - Report
From Monolith to Observable Microservices using DDD
Splitting the monolith using Domain Driven Design
Observable Microservices (O'Reilly SACon London 2018)
Effective team onboarding
Observable microservices (O'Reilly SACon NY 2018)
Security in agile teams
Security in agile teams
Observable Microservices
Splitting the Monolith
Taller de Refactorización (Campus Party Quito 2014)
Refactoring workshop (Campus Party Quito 2014)
Project Management - Report
Principles of New Media - Essay
Project Management - Risk management
Responsive Environments - MoodMixer Presentation
Responsive Environments - Critical report
New Media Management - Gantt chart
New Media Management - Project plan
New Media Management - Presentation
New Media Management - Report

Recently uploaded (20)

PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
history of c programming in notes for students .pptx
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPT
Introduction Database Management System for Course Database
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
ai tools demonstartion for schools and inter college
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Introduction to Artificial Intelligence
PDF
Softaken Excel to vCard Converter Software.pdf
Design an Analysis of Algorithms II-SECS-1021-03
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Designing Intelligence for the Shop Floor.pdf
Odoo Companies in India – Driving Business Transformation.pdf
history of c programming in notes for students .pptx
Navsoft: AI-Powered Business Solutions & Custom Software Development
Design an Analysis of Algorithms I-SECS-1021-03
Introduction Database Management System for Course Database
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
wealthsignaloriginal-com-DS-text-... (1).pdf
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Computer Software and OS of computer science of grade 11.pptx
ai tools demonstartion for schools and inter college
Wondershare Filmora 15 Crack With Activation Key [2025
Adobe Illustrator 28.6 Crack My Vision of Vector Design
How to Choose the Right IT Partner for Your Business in Malaysia
Upgrade and Innovation Strategies for SAP ERP Customers
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Introduction to Artificial Intelligence
Softaken Excel to vCard Converter Software.pdf

CQRS and Event Sourcing: A DevOps perspective