際際滷

際際滷Share a Scribd company logo
WHATS THAT CQRS
THING?
introduction for adopters
effect
free!
COMMAND QUERY
RESPONSIBILITY
SEGREGATION PATTERN
ORIGINAL SIN
CREATE
READ
UPDATE
DELETE
...hai detto CQRS a chi ?!?!?!
...hai detto CQRS a chi ?!?!?!
is an architectural pattern proposed by Greg
Young that segregates reads and writes of a
system into two separate subsystems.
CQRS
writes are usually asynchronous and
stored in a transactional storage while
reads are eventually consistent and
retrieved from de-normalised views
CQRS (details)
BERTRAND MAYER
Designer of Eiffel
programming language
Coined open/closed
principle and design
by contract
Introduced command
query separation
(CQS)
Use of commands and queries separates write and read concerns
COMMAND
Tell to do something
COMMAND
 Command is the message to change state
 Message handled by a CommandHandler
 Returns void (so nothing)
 Describes business intent
 Immutable
QUERY
Fetch state from data store
QUERY
 Read state from data store
 Does not change state
 Has a return value
WHY SHOULD I USE CQRS?
 Scalability
 Reduced complexity
 Flexibility
 Focus on the business
 Fear of change
 Mental leap
 All-Or-Nothing approach
BE AWARE OF
CQRS MYTHS
 is easy
 CQRS = Event Sourcing and vice versa
 requires an eventual consistent read store
 requires a bus/queues/asynchronous messaging
 Udi Dahan
Most people using CQRS (and event sourcing too)
shouldn't have done so
 GregYoung
It's important to note though, that these are things you
can do, not necessarily things you should do.
Separating the read and write models can be quite costly
WHEN SHOULD I AVOID IT?
WHATS NEXT?
 Event sourcing (ES)
 Eventual consistency
 Task based UI
...hai detto CQRS a chi ?!?!?!
Thank you.
@realfuzzy
Michele Franzin
CREDITS
slide10 - www.defenceimagery.mod.uk - 45155579
slide 12 - https://www.鍖ickr.com/photos/broeckxsven/
slides 4,9 - http://martinfowler.com/bliki/
http://martinfowler.com/bliki/CQRS.html
http://udidahan.com/2009/12/09/clari鍖ed-cqrs/
https://en.wikipedia.org/wiki/Commandquery_separation
https://cqrs.鍖les.wordpress.com/2010/11/cqrs_documents.pdf
RESOURCES

More Related Content

Similar to ...hai detto CQRS a chi ?!?!?! (20)

Cqrs and Event Sourcing Intro For Developers
Cqrs and Event Sourcing Intro For DevelopersCqrs and Event Sourcing Intro For Developers
Cqrs and Event Sourcing Intro For Developers
wojtek_s
Distributed query deep dive conor cunningham
Distributed query deep dive   conor cunninghamDistributed query deep dive   conor cunningham
Distributed query deep dive conor cunningham
Radityo Prasetianto Wibowo
JavaScript for Enterprise Applications
JavaScript for Enterprise ApplicationsJavaScript for Enterprise Applications
JavaScript for Enterprise Applications
Piyush Katariya
CQRS recipes or how to cook your architecture
CQRS recipes or how to cook your architectureCQRS recipes or how to cook your architecture
CQRS recipes or how to cook your architecture
Thomas Jaskula
NOS DevDays 2014 | CQRS+ES
NOS DevDays 2014 | CQRS+ESNOS DevDays 2014 | CQRS+ES
NOS DevDays 2014 | CQRS+ES
Miguel Hasse de Oliveira
CQRS - Eine Einf端hrung - NOUG 2011
CQRS - Eine Einf端hrung - NOUG 2011CQRS - Eine Einf端hrung - NOUG 2011
CQRS - Eine Einf端hrung - NOUG 2011
Dennis Traub
Cqrs but different
Cqrs but differentCqrs but different
Cqrs but different
Particular Software
The CQRS diet
The CQRS dietThe CQRS diet
The CQRS diet
Luismi Cavall辿
Deep Dive into Slick
Deep Dive into SlickDeep Dive into Slick
Deep Dive into Slick
Knoldus Inc.
CQRS
CQRSCQRS
CQRS
Touraj Ebrahimi
Transactions and Concurrency Control Patterns
Transactions and Concurrency Control PatternsTransactions and Concurrency Control Patterns
Transactions and Concurrency Control Patterns
Vlad Mihalcea
Lets focus on business value
Lets focus on business valueLets focus on business value
Lets focus on business value
Einar Ingebrigtsen
Workshop - cqrs brief introduction
Workshop - cqrs brief introductionWorkshop - cqrs brief introduction
Workshop - cqrs brief introduction
Francesco Garavaglia
Server-Side Development for the Cloud
Server-Side Developmentfor the CloudServer-Side Developmentfor the Cloud
Server-Side Development for the Cloud
Michael Rosenblum
Barcamp presentation
Barcamp presentationBarcamp presentation
Barcamp presentation
Vachagan Balayan
Recap: OSCON 2015
Recap: OSCON 2015Recap: OSCON 2015
Recap: OSCON 2015
Spandana Govindgari
Solid OO & Clean Coding is essential to successful Agile development
Solid OO & Clean Coding is essential to successful Agile developmentSolid OO & Clean Coding is essential to successful Agile development
Solid OO & Clean Coding is essential to successful Agile development
Simon Gould
Refactoring.pdf
Refactoring.pdfRefactoring.pdf
Refactoring.pdf
Mnats Karakhanyan
Dr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. HydeDr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. Hyde
webhostingguy
SQLCLR For DBAs and Developers
SQLCLR For DBAs and DevelopersSQLCLR For DBAs and Developers
SQLCLR For DBAs and Developers
webhostingguy
Cqrs and Event Sourcing Intro For Developers
Cqrs and Event Sourcing Intro For DevelopersCqrs and Event Sourcing Intro For Developers
Cqrs and Event Sourcing Intro For Developers
wojtek_s
Distributed query deep dive conor cunningham
Distributed query deep dive   conor cunninghamDistributed query deep dive   conor cunningham
Distributed query deep dive conor cunningham
Radityo Prasetianto Wibowo
JavaScript for Enterprise Applications
JavaScript for Enterprise ApplicationsJavaScript for Enterprise Applications
JavaScript for Enterprise Applications
Piyush Katariya
CQRS recipes or how to cook your architecture
CQRS recipes or how to cook your architectureCQRS recipes or how to cook your architecture
CQRS recipes or how to cook your architecture
Thomas Jaskula
CQRS - Eine Einf端hrung - NOUG 2011
CQRS - Eine Einf端hrung - NOUG 2011CQRS - Eine Einf端hrung - NOUG 2011
CQRS - Eine Einf端hrung - NOUG 2011
Dennis Traub
Deep Dive into Slick
Deep Dive into SlickDeep Dive into Slick
Deep Dive into Slick
Knoldus Inc.
Transactions and Concurrency Control Patterns
Transactions and Concurrency Control PatternsTransactions and Concurrency Control Patterns
Transactions and Concurrency Control Patterns
Vlad Mihalcea
Lets focus on business value
Lets focus on business valueLets focus on business value
Lets focus on business value
Einar Ingebrigtsen
Workshop - cqrs brief introduction
Workshop - cqrs brief introductionWorkshop - cqrs brief introduction
Workshop - cqrs brief introduction
Francesco Garavaglia
Server-Side Development for the Cloud
Server-Side Developmentfor the CloudServer-Side Developmentfor the Cloud
Server-Side Development for the Cloud
Michael Rosenblum
Solid OO & Clean Coding is essential to successful Agile development
Solid OO & Clean Coding is essential to successful Agile developmentSolid OO & Clean Coding is essential to successful Agile development
Solid OO & Clean Coding is essential to successful Agile development
Simon Gould
Dr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. HydeDr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. Hyde
webhostingguy
SQLCLR For DBAs and Developers
SQLCLR For DBAs and DevelopersSQLCLR For DBAs and Developers
SQLCLR For DBAs and Developers
webhostingguy

More from michele franzin (6)

Unleashing git power
Unleashing git powerUnleashing git power
Unleashing git power
michele franzin
Come ti smantello un'app monolitica in microservices
Come ti smantello un'app monolitica in microservicesCome ti smantello un'app monolitica in microservices
Come ti smantello un'app monolitica in microservices
michele franzin
Microservices: cosa sono e quando non usarli
Microservices: cosa sono e quando non usarliMicroservices: cosa sono e quando non usarli
Microservices: cosa sono e quando non usarli
michele franzin
Ruby 20th birthday
Ruby 20th birthdayRuby 20th birthday
Ruby 20th birthday
michele franzin
Magie di git
Magie di gitMagie di git
Magie di git
michele franzin
from(0).to('rubygems.org')
from(0).to('rubygems.org')from(0).to('rubygems.org')
from(0).to('rubygems.org')
michele franzin
Come ti smantello un'app monolitica in microservices
Come ti smantello un'app monolitica in microservicesCome ti smantello un'app monolitica in microservices
Come ti smantello un'app monolitica in microservices
michele franzin
Microservices: cosa sono e quando non usarli
Microservices: cosa sono e quando non usarliMicroservices: cosa sono e quando non usarli
Microservices: cosa sono e quando non usarli
michele franzin
from(0).to('rubygems.org')
from(0).to('rubygems.org')from(0).to('rubygems.org')
from(0).to('rubygems.org')
michele franzin

Recently uploaded (20)

Lecture 2 - Definition and Goals of a Distributed System.ppt
Lecture 2 - Definition and Goals of a Distributed System.pptLecture 2 - Definition and Goals of a Distributed System.ppt
Lecture 2 - Definition and Goals of a Distributed System.ppt
KostadinKostadin
A comprehensive guide to Starlink technology and its availability in Florida.pdf
A comprehensive guide to Starlink technology and its availability in Florida.pdfA comprehensive guide to Starlink technology and its availability in Florida.pdf
A comprehensive guide to Starlink technology and its availability in Florida.pdf
Internet Bundle Now
HiSTEAM 2nd onwwwwwwwwwwwwwwwwwwwww.pptx
HiSTEAM 2nd onwwwwwwwwwwwwwwwwwwwww.pptxHiSTEAM 2nd onwwwwwwwwwwwwwwwwwwwww.pptx
HiSTEAM 2nd onwwwwwwwwwwwwwwwwwwwww.pptx
pbhathiwala
Shift Towards Authentic Social Media Engagement
Shift Towards Authentic Social Media EngagementShift Towards Authentic Social Media Engagement
Shift Towards Authentic Social Media Engagement
webcooks Digital Academy
Innovation and Problem Solving- an overview (2).pptx
Innovation and Problem Solving- an overview (2).pptxInnovation and Problem Solving- an overview (2).pptx
Innovation and Problem Solving- an overview (2).pptx
aishwaryasharma63637
Professional Freelance Digital Marketing Services in Chandigarh.pptx
Professional Freelance Digital Marketing Services in Chandigarh.pptxProfessional Freelance Digital Marketing Services in Chandigarh.pptx
Professional Freelance Digital Marketing Services in Chandigarh.pptx
Professional Freelance Digital Marketing Services in Chandigarh
Kalin Karakehayov - The mindset and habits for building an SEO Empire
Kalin Karakehayov - The mindset and habits for building an SEO EmpireKalin Karakehayov - The mindset and habits for building an SEO Empire
Kalin Karakehayov - The mindset and habits for building an SEO Empire
Kalin Karakehayov
Microsoft Authenticator on Mac MicrosofMicrosoft
Microsoft Authenticator on Mac MicrosofMicrosoftMicrosoft Authenticator on Mac MicrosofMicrosoft
Microsoft Authenticator on Mac MicrosofMicrosoft
bestauthenticatorapp1
How to Create a Digital Marketing Strategy - Leadcrew
How to Create a Digital Marketing Strategy - LeadcrewHow to Create a Digital Marketing Strategy - Leadcrew
How to Create a Digital Marketing Strategy - Leadcrew
Leadcrew - Digital Marketing Agency in Karachi
Presentations.docx...............................................
Presentations.docx...............................................Presentations.docx...............................................
Presentations.docx...............................................
gaellagsan
Lesson-1-Multimedia (1) Explore the principle of interactivity and rich conte...
Lesson-1-Multimedia (1) Explore the principle of interactivity and rich conte...Lesson-1-Multimedia (1) Explore the principle of interactivity and rich conte...
Lesson-1-Multimedia (1) Explore the principle of interactivity and rich conte...
JaneCalzada
The Importance of Customer Support for Starlink Users in Florida.pdf
The Importance of Customer Support for Starlink Users in Florida.pdfThe Importance of Customer Support for Starlink Users in Florida.pdf
The Importance of Customer Support for Starlink Users in Florida.pdf
Internet Bundle Now
Grand Theft Auto V Crack For PC [Latest Free] Free Download
Grand Theft Auto V Crack For PC [Latest Free] Free DownloadGrand Theft Auto V Crack For PC [Latest Free] Free Download
Grand Theft Auto V Crack For PC [Latest Free] Free Download
noorkhan1x1
How ISPs Can Help Protect Users from Cyber Threats.pdf
How ISPs Can Help Protect Users from Cyber Threats.pdfHow ISPs Can Help Protect Users from Cyber Threats.pdf
How ISPs Can Help Protect Users from Cyber Threats.pdf
Internet Bundle Now
Building a Multiplatform SDKMAN in JavaFX [JavaOne]
Building a Multiplatform SDKMAN in JavaFX [JavaOne]Building a Multiplatform SDKMAN in JavaFX [JavaOne]
Building a Multiplatform SDKMAN in JavaFX [JavaOne]
Jago de Vreede
From a train to a transit system: enabling self-directed user journeys
From a train to a transit system: enabling self-directed user journeysFrom a train to a transit system: enabling self-directed user journeys
From a train to a transit system: enabling self-directed user journeys
Michael Priestley
032ssssssssssssssssssssssssssssssssssss024-PBD.pptx
032ssssssssssssssssssssssssssssssssssss024-PBD.pptx032ssssssssssssssssssssssssssssssssssss024-PBD.pptx
032ssssssssssssssssssssssssssssssssssss024-PBD.pptx
Anonymoushbl0ek0qdZ
Client Relations in a Virtual World Maintaining Trust and Communication
Client Relations in a Virtual World  Maintaining Trust and CommunicationClient Relations in a Virtual World  Maintaining Trust and Communication
Client Relations in a Virtual World Maintaining Trust and Communication
john823664
1-Information-and-Communication-Technology (1).pptx
1-Information-and-Communication-Technology (1).pptx1-Information-and-Communication-Technology (1).pptx
1-Information-and-Communication-Technology (1).pptx
JaneCalzada
The Decision Buy-In Algorithm - RVAJS 2025
The Decision Buy-In Algorithm - RVAJS 2025The Decision Buy-In Algorithm - RVAJS 2025
The Decision Buy-In Algorithm - RVAJS 2025
John Riviello
Lecture 2 - Definition and Goals of a Distributed System.ppt
Lecture 2 - Definition and Goals of a Distributed System.pptLecture 2 - Definition and Goals of a Distributed System.ppt
Lecture 2 - Definition and Goals of a Distributed System.ppt
KostadinKostadin
A comprehensive guide to Starlink technology and its availability in Florida.pdf
A comprehensive guide to Starlink technology and its availability in Florida.pdfA comprehensive guide to Starlink technology and its availability in Florida.pdf
A comprehensive guide to Starlink technology and its availability in Florida.pdf
Internet Bundle Now
HiSTEAM 2nd onwwwwwwwwwwwwwwwwwwwww.pptx
HiSTEAM 2nd onwwwwwwwwwwwwwwwwwwwww.pptxHiSTEAM 2nd onwwwwwwwwwwwwwwwwwwwww.pptx
HiSTEAM 2nd onwwwwwwwwwwwwwwwwwwwww.pptx
pbhathiwala
Shift Towards Authentic Social Media Engagement
Shift Towards Authentic Social Media EngagementShift Towards Authentic Social Media Engagement
Shift Towards Authentic Social Media Engagement
webcooks Digital Academy
Innovation and Problem Solving- an overview (2).pptx
Innovation and Problem Solving- an overview (2).pptxInnovation and Problem Solving- an overview (2).pptx
Innovation and Problem Solving- an overview (2).pptx
aishwaryasharma63637
Kalin Karakehayov - The mindset and habits for building an SEO Empire
Kalin Karakehayov - The mindset and habits for building an SEO EmpireKalin Karakehayov - The mindset and habits for building an SEO Empire
Kalin Karakehayov - The mindset and habits for building an SEO Empire
Kalin Karakehayov
Microsoft Authenticator on Mac MicrosofMicrosoft
Microsoft Authenticator on Mac MicrosofMicrosoftMicrosoft Authenticator on Mac MicrosofMicrosoft
Microsoft Authenticator on Mac MicrosofMicrosoft
bestauthenticatorapp1
Presentations.docx...............................................
Presentations.docx...............................................Presentations.docx...............................................
Presentations.docx...............................................
gaellagsan
Lesson-1-Multimedia (1) Explore the principle of interactivity and rich conte...
Lesson-1-Multimedia (1) Explore the principle of interactivity and rich conte...Lesson-1-Multimedia (1) Explore the principle of interactivity and rich conte...
Lesson-1-Multimedia (1) Explore the principle of interactivity and rich conte...
JaneCalzada
The Importance of Customer Support for Starlink Users in Florida.pdf
The Importance of Customer Support for Starlink Users in Florida.pdfThe Importance of Customer Support for Starlink Users in Florida.pdf
The Importance of Customer Support for Starlink Users in Florida.pdf
Internet Bundle Now
Grand Theft Auto V Crack For PC [Latest Free] Free Download
Grand Theft Auto V Crack For PC [Latest Free] Free DownloadGrand Theft Auto V Crack For PC [Latest Free] Free Download
Grand Theft Auto V Crack For PC [Latest Free] Free Download
noorkhan1x1
How ISPs Can Help Protect Users from Cyber Threats.pdf
How ISPs Can Help Protect Users from Cyber Threats.pdfHow ISPs Can Help Protect Users from Cyber Threats.pdf
How ISPs Can Help Protect Users from Cyber Threats.pdf
Internet Bundle Now
Building a Multiplatform SDKMAN in JavaFX [JavaOne]
Building a Multiplatform SDKMAN in JavaFX [JavaOne]Building a Multiplatform SDKMAN in JavaFX [JavaOne]
Building a Multiplatform SDKMAN in JavaFX [JavaOne]
Jago de Vreede
From a train to a transit system: enabling self-directed user journeys
From a train to a transit system: enabling self-directed user journeysFrom a train to a transit system: enabling self-directed user journeys
From a train to a transit system: enabling self-directed user journeys
Michael Priestley
032ssssssssssssssssssssssssssssssssssss024-PBD.pptx
032ssssssssssssssssssssssssssssssssssss024-PBD.pptx032ssssssssssssssssssssssssssssssssssss024-PBD.pptx
032ssssssssssssssssssssssssssssssssssss024-PBD.pptx
Anonymoushbl0ek0qdZ
Client Relations in a Virtual World Maintaining Trust and Communication
Client Relations in a Virtual World  Maintaining Trust and CommunicationClient Relations in a Virtual World  Maintaining Trust and Communication
Client Relations in a Virtual World Maintaining Trust and Communication
john823664
1-Information-and-Communication-Technology (1).pptx
1-Information-and-Communication-Technology (1).pptx1-Information-and-Communication-Technology (1).pptx
1-Information-and-Communication-Technology (1).pptx
JaneCalzada
The Decision Buy-In Algorithm - RVAJS 2025
The Decision Buy-In Algorithm - RVAJS 2025The Decision Buy-In Algorithm - RVAJS 2025
The Decision Buy-In Algorithm - RVAJS 2025
John Riviello

...hai detto CQRS a chi ?!?!?!