CQRS without event sourcing

Thomas Pierrain
Thomas PierrainChange Agent (powered by software). Symmathecist & VP of Engineering @AgicapFrance . Organizer of #DDDFR meetup #lowLatency #XP #nfluent creator
Thomas PIERRAIN
@tpierrain
Bruno BOUCARD
@brunoboucard
Tomasz JASKULA
@tjaskula
Eric VERNIE
@EricVernie
CQRS
(without Event Sourcing)
Why CQRS
Scalability issues?
The Pareto
Principle
80-20
Root cause
0%0%
80%
reading
20%
writing
…only one central
component to deal
with a wide range
of constraints.
With…
Do you have those constraints in mind
while designing your architectures?
A question
(for you)
How to optimize an app that has to scale
for massive read accesses?
So…
This is where
CQRS is…
CQRS (short version)
CQRS splits the 80s and the 20s
CQRS splits the 80s and the 20s
20 % of time
80 % of time
C
Q
R
S
Behind the acronym
( powered by Greg YOUNG - @gregyoung )
Command
Query
Responsibility
Segregation
Behind the acronym
Command
Query
Responsibility
Segregation
Behind the acronym
CQRS illustrated
CQRS illustrated
CQRS illustrated
CQRS illustrated
CQRS illustrated
CQRS illustrated
CQRS illustrated
CQRS illustrated
CQRS illustrated
CQRS illustrated
CQRS illustrated
CQRS illustrated
CQRS illustrated
CQRS illustrated
CQRS illustrated
Classical
transactional
databases
RDBMS
(ACID)
« ready-to-eat
data », Caches,
non-normalized
models,
(no SQL)
CQRS illustrated
Command
TRIGGERS AN ACTION
Modify the state of the system
>> Don’t return data ! <<
Imperative Verb
Ex: BookARoom
Query
ASKS FOR AN INFORMATION
Read-only!
Get back data
Imperative Verb
Ex: GetAvailableRooms
Event
ALREADY HAPPENED
(Immutable)
Past-tense
Ex: RoomBooked
Demo
Open Source Implementation available on GitHub
2 main parts:
CoreClr (Runtime execution) (C++)
CoreFx (including classes, collections, file systems, xml, etc.) (C#)
ASP.NET Core 1.0 framework relies on it
Classic deployment or
Container deployment (Linux or Windows)
.NET Core
// Licensed to the .NET Foundation under one or more agreements.
CQRS without event sourcing
CQRS without event sourcing
CQRS without event sourcing
CQRS without event sourcing
Live coding
Wrap-up
Warning!
…a top-level architecture pattern
Use it for components under stress
Do not generalize its usage for all the components of your platform!
CQRS is not…
Event Sourcing
Also, CQRS is not…
CQRS Event Sourcing
but
CQRS != Event Sourcing
To conclude…
Well-separated read and write concerns
CQRS is mostly
Queries
Caches, Ready-
to-eat data
(no SQL)
Commands
Transactionnal
ACID
Merci aussi à Rui CARVALHO, Mendel MONTEIRO-BECKERMAN,
Olivier COANET et Clément BOUDEREAU ainsi que Greg YOUNG
pour leurs feedbacks et idées pour ce talk.
CQRS origins
Origine de CQRS
Origine de CQRS
Origine de CQRS
Wanna play the lab @home?
Follow the white rabbit here:
https://github.com/tpierrain/CQRS/blob/master/LabInstructions.
md
@microsoftfrance @Technet_France @msdev_fr
@tpierrain @brunoboucard @tjaskula @EricVernie
CQRS without event sourcing
1 of 53

More Related Content

What's hot(20)

Introduction to CI/CDIntroduction to CI/CD
Introduction to CI/CD
Steve Mactaggart14.8K views
SonarqubeSonarqube
Sonarqube
Peerapat Asoktummarungsri14.3K views
TDD refresherTDD refresher
TDD refresher
Kerry Buckley1.1K views
Jenkins CI presentationJenkins CI presentation
Jenkins CI presentation
Jonathan Holloway13.8K views
Continuous Delivery, Continuous Integration Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration
Amazon Web Services3.6K views
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean Architecture
Mattia Battiston36.5K views
Understanding angular jsUnderstanding angular js
Understanding angular js
Aayush Shrestha5.4K views
Spring boot introductionSpring boot introduction
Spring boot introduction
Rasheed Waraich7.7K views
Selenium  with Cucumber Selenium  with Cucumber
Selenium with Cucumber
Knoldus Inc.486 views
CICD with JenkinsCICD with Jenkins
CICD with Jenkins
Vietnam Open Infrastructure User Group1.4K views
Pros & cons of sveltePros & cons of svelte
Pros & cons of svelte
ElenorWisozk415 views
Universal React apps in Next.jsUniversal React apps in Next.js
Universal React apps in Next.js
🐕 Łukasz Ostrowski1.9K views
Introduction to BDDIntroduction to BDD
Introduction to BDD
Knoldus Inc.2.6K views
How to build massive service for advanceHow to build massive service for advance
How to build massive service for advance
DaeMyung Kang13.2K views

Viewers also liked(20)

The art of Software DesignThe art of Software Design
The art of Software Design
Thomas Pierrain2.2K views
Ddd reboot (english version)Ddd reboot (english version)
Ddd reboot (english version)
Thomas Pierrain3K views
Culture craft humantalksCulture craft humantalks
Culture craft humantalks
Thomas Pierrain2.2K views
Faible latence haut debit Devoxx FR 2014Faible latence haut debit Devoxx FR 2014
Faible latence haut debit Devoxx FR 2014
Thomas Pierrain1.6K views
Async await...oh wait!Async await...oh wait!
Async await...oh wait!
Thomas Pierrain6K views
.NET Inside - Microservices, .NET Core e Serverless.NET Inside - Microservices, .NET Core e Serverless
.NET Inside - Microservices, .NET Core e Serverless
Ulili Emerson Martins Nhaga613 views
A Pattern Language for MicroservicesA Pattern Language for Microservices
A Pattern Language for Microservices
Chris Richardson2.5K views
Sortir de notre zone de confortSortir de notre zone de confort
Sortir de notre zone de confort
Thomas Pierrain1.4K views

More from Thomas Pierrain(16)

Hexagonal And BeyondHexagonal And Beyond
Hexagonal And Beyond
Thomas Pierrain373 views
De l'autre côté du miroirDe l'autre côté du miroir
De l'autre côté du miroir
Thomas Pierrain250 views
eXtremeeXtreme
eXtreme
Thomas Pierrain217 views
Beyond Hexagonal architectureBeyond Hexagonal architecture
Beyond Hexagonal architecture
Thomas Pierrain461 views
The 9 rules of debuggingThe 9 rules of debugging
The 9 rules of debugging
Thomas Pierrain439 views
Une nuit dans l'hexagoneUne nuit dans l'hexagone
Une nuit dans l'hexagone
Thomas Pierrain443 views
Equiper sa voieEquiper sa voie
Equiper sa voie
Thomas Pierrain605 views
As time goes by (episode 2)As time goes by (episode 2)
As time goes by (episode 2)
Thomas Pierrain1.6K views
Et si on parlait Éthique ?Et si on parlait Éthique ?
Et si on parlait Éthique ?
Thomas Pierrain590 views
Legacy club (english version)Legacy club (english version)
Legacy club (english version)
Thomas Pierrain556 views
Culture Craft Devoxx 2015Culture Craft Devoxx 2015
Culture Craft Devoxx 2015
Thomas Pierrain1.1K views

CQRS without event sourcing