SlideShare ist ein Scribd-Unternehmen logo
1 von 63
IntroductionCQRS Pieter Joost van de Sande
Thank you VSOFT!!
Agenda ,[object Object]
What CQRS changes to that
Building a CQRS architecture
Some demo stuff
Discussion
Beer!,[object Object]
Typical architectures
Typical architectures Presentation Domain Data
N-Layer ,[object Object]
Simple separation that is easy to explain.
Higher abstraction with each layer.
Known by a lot of people.
Supportedby tools andframeworks
Lots of resources available,[object Object]
Typical architectures
TWO fundamental things Every system has this
data
Transitions
What is CQRS? COMMAND QUERY RESPONSIBILITY SEGREGATION
Cqrs Concept Move from N-layer to…
N-LAYERarchitecture Presentation Domain Data
Presentation Domain Data
Presentation Domain Data
Presentation Domain Data
Presentation Read State transitions Domain Data
fromCQRS Concepttoarchitecture This adds more value!
User interface
Demand for data Because we have some screens to fill
WE read a lot
WE have multiple screens to fill
Data should be close to us
Demandfor data ,[object Object]
It shouldnot have toexecute business rules on the data.
It requests data manytimes.
It shouldbe close tous.
Getting data shouldbesimple (select * from x where y)Examples: Get all products of user X Get total price of all orders of month May
User interface
Read side User interface
Read side Read databases User interface
Read side Read databases query User interface
Read side The only need it has to serve is reading. ,[object Object]
Contains the data in an form we need
Facades should be minimized
Read models do not have to be on one location...
They should be close to the client,[object Object]
Demand for change Otherwise things are static
I want to tell the system something Please move customer X to this new address
Change has intent Users don’t make changes for nothing. This intent has value! Correct the address for user X Customer X moved to new address VS.
Multiple steps Users can take multiple steps before they reach the end goal. These steps can be very useful to us.
Commands ,[object Object]
Commands contain all the data needed to execute the underlying action.
Contain the intent of the change.Examples: AddProductToShoppingCart PurchaseOrder MoveUserToNewAddress CorrectAddressForUser
Read side Read databases query User interface
Read side Write side Read databases query User interface
Read side Write side Read databases Commandhandlers commands query User interface
Read side Write side Read databases Facade Domain Commandhandlers commands DTO’s User interface
Greg Young: “State transitions are an important part of our problem space and should be modeled within our domain.”
The ‘old’ domain model
Domain focused on behavior

Weitere ähnliche Inhalte

Andere mochten auch

Repurpose Your Career - 5 Steps to your Next Career Pivot
Repurpose Your Career - 5 Steps to your Next Career PivotRepurpose Your Career - 5 Steps to your Next Career Pivot
Repurpose Your Career - 5 Steps to your Next Career Pivot
Career Pivot
 
Рекоменд. письмо_МинСпорт
Рекоменд. письмо_МинСпортРекоменд. письмо_МинСпорт
Рекоменд. письмо_МинСпорт
Natalia Sidorkina
 
MLConf - Emmys, Oscars & Machine Learning Algorithms at Netflix
MLConf - Emmys, Oscars & Machine Learning Algorithms at NetflixMLConf - Emmys, Oscars & Machine Learning Algorithms at Netflix
MLConf - Emmys, Oscars & Machine Learning Algorithms at Netflix
Xavier Amatriain
 

Andere mochten auch (13)

Social Media are serious or maybe #not
Social Media are serious or maybe #notSocial Media are serious or maybe #not
Social Media are serious or maybe #not
 
Gesture drawing
Gesture drawingGesture drawing
Gesture drawing
 
Repurpose Your Career - 5 Steps to your Next Career Pivot
Repurpose Your Career - 5 Steps to your Next Career PivotRepurpose Your Career - 5 Steps to your Next Career Pivot
Repurpose Your Career - 5 Steps to your Next Career Pivot
 
Professor Joanne Goodell presents Performance Based Funding
Professor Joanne Goodell presents Performance Based FundingProfessor Joanne Goodell presents Performance Based Funding
Professor Joanne Goodell presents Performance Based Funding
 
Рекоменд. письмо_МинСпорт
Рекоменд. письмо_МинСпортРекоменд. письмо_МинСпорт
Рекоменд. письмо_МинСпорт
 
Intro
IntroIntro
Intro
 
The Top 10 Mistakes on Local Websites & How to Fix Them
The Top 10 Mistakes on Local Websites & How to Fix ThemThe Top 10 Mistakes on Local Websites & How to Fix Them
The Top 10 Mistakes on Local Websites & How to Fix Them
 
SEO & Social Media Explained
SEO & Social Media ExplainedSEO & Social Media Explained
SEO & Social Media Explained
 
Olympics team usa bsktball rio 2016 defenders
Olympics team usa bsktball rio 2016 defendersOlympics team usa bsktball rio 2016 defenders
Olympics team usa bsktball rio 2016 defenders
 
MLConf - Emmys, Oscars & Machine Learning Algorithms at Netflix
MLConf - Emmys, Oscars & Machine Learning Algorithms at NetflixMLConf - Emmys, Oscars & Machine Learning Algorithms at Netflix
MLConf - Emmys, Oscars & Machine Learning Algorithms at Netflix
 
El diario
El diarioEl diario
El diario
 
Phonetic sounds i
Phonetic sounds iPhonetic sounds i
Phonetic sounds i
 
Hướng dẫn chuẩn bị cho kì thi JLPT 2014
Hướng dẫn chuẩn bị cho kì thi JLPT 2014Hướng dẫn chuẩn bị cho kì thi JLPT 2014
Hướng dẫn chuẩn bị cho kì thi JLPT 2014
 

Ähnlich wie Introduction to CQRS

La creación de una capa operacional con MongoDB
La creación de una capa operacional con MongoDBLa creación de una capa operacional con MongoDB
La creación de una capa operacional con MongoDB
MongoDB
 
Enabling multi tenancy(An Industrial Experience Report)
Enabling multi tenancy(An Industrial Experience Report)Enabling multi tenancy(An Industrial Experience Report)
Enabling multi tenancy(An Industrial Experience Report)
ICSM 2010
 
M-Files Enterprise Content Management Software
M-Files Enterprise Content Management SoftwareM-Files Enterprise Content Management Software
M-Files Enterprise Content Management Software
Chris Davidson
 
How to Get Cloud Architecture and Design Right the First Time
How to Get Cloud Architecture and Design Right the First TimeHow to Get Cloud Architecture and Design Right the First Time
How to Get Cloud Architecture and Design Right the First Time
David Linthicum
 
Advanced web application architecture - PHP Barcelona
Advanced web application architecture  - PHP BarcelonaAdvanced web application architecture  - PHP Barcelona
Advanced web application architecture - PHP Barcelona
Matthias Noback
 
Legacy Migration Overview
Legacy Migration OverviewLegacy Migration Overview
Legacy Migration Overview
Bambordé Baldé
 
Legacy Migration
Legacy MigrationLegacy Migration
Legacy Migration
WORPCLOUD LTD
 
Multi Tier Architecture
Multi Tier ArchitectureMulti Tier Architecture
Multi Tier Architecture
gatigno
 

Ähnlich wie Introduction to CQRS (20)

CQRS: A More Effective Way of Writing the Same Applications
CQRS: A More Effective Way of Writing the Same ApplicationsCQRS: A More Effective Way of Writing the Same Applications
CQRS: A More Effective Way of Writing the Same Applications
 
Exploiting the Data / Code Duality with Dali
Exploiting the Data / Code Duality with DaliExploiting the Data / Code Duality with Dali
Exploiting the Data / Code Duality with Dali
 
La creación de una capa operacional con MongoDB
La creación de una capa operacional con MongoDBLa creación de una capa operacional con MongoDB
La creación de una capa operacional con MongoDB
 
How to choose the right software
How to choose the right softwareHow to choose the right software
How to choose the right software
 
A CQRS Journey
A CQRS JourneyA CQRS Journey
A CQRS Journey
 
Enabling multi tenancy(An Industrial Experience Report)
Enabling multi tenancy(An Industrial Experience Report)Enabling multi tenancy(An Industrial Experience Report)
Enabling multi tenancy(An Industrial Experience Report)
 
Raleigh Kafka Meetup - DDD, ES, and CQRS
Raleigh Kafka Meetup - DDD, ES, and CQRSRaleigh Kafka Meetup - DDD, ES, and CQRS
Raleigh Kafka Meetup - DDD, ES, and CQRS
 
Architecting for Change: An Agile Approach
Architecting for Change: An Agile ApproachArchitecting for Change: An Agile Approach
Architecting for Change: An Agile Approach
 
M-Files Enterprise Content Management Software
M-Files Enterprise Content Management SoftwareM-Files Enterprise Content Management Software
M-Files Enterprise Content Management Software
 
How to Get Cloud Architecture and Design Right the First Time
How to Get Cloud Architecture and Design Right the First TimeHow to Get Cloud Architecture and Design Right the First Time
How to Get Cloud Architecture and Design Right the First Time
 
Greenfield Development with CQRS
Greenfield Development with CQRSGreenfield Development with CQRS
Greenfield Development with CQRS
 
Advanced web application architecture - PHP Barcelona
Advanced web application architecture  - PHP BarcelonaAdvanced web application architecture  - PHP Barcelona
Advanced web application architecture - PHP Barcelona
 
Cloud First Architecture
Cloud First ArchitectureCloud First Architecture
Cloud First Architecture
 
Legacy Migration Overview
Legacy Migration OverviewLegacy Migration Overview
Legacy Migration Overview
 
Legacy Migration
Legacy MigrationLegacy Migration
Legacy Migration
 
Introduction to Puppet Enterprise 10/03/2018
Introduction to Puppet Enterprise 10/03/2018Introduction to Puppet Enterprise 10/03/2018
Introduction to Puppet Enterprise 10/03/2018
 
Everything you want to know about microservices
Everything you want to know about microservicesEverything you want to know about microservices
Everything you want to know about microservices
 
Crafted Design - Sandro Mancuso
Crafted Design - Sandro MancusoCrafted Design - Sandro Mancuso
Crafted Design - Sandro Mancuso
 
Cloud Migration headache? Ease the pain with Data Virtualization! (EMEA)
Cloud Migration headache? Ease the pain with Data Virtualization! (EMEA)Cloud Migration headache? Ease the pain with Data Virtualization! (EMEA)
Cloud Migration headache? Ease the pain with Data Virtualization! (EMEA)
 
Multi Tier Architecture
Multi Tier ArchitectureMulti Tier Architecture
Multi Tier Architecture
 

Mehr von Pieter Joost van de Sande (13)

Actor Model
Actor ModelActor Model
Actor Model
 
Microservices
MicroservicesMicroservices
Microservices
 
Microservices
MicroservicesMicroservices
Microservices
 
Werckers path to Go
Werckers path to GoWerckers path to Go
Werckers path to Go
 
Lessons for developers - long edition
Lessons for developers  - long editionLessons for developers  - long edition
Lessons for developers - long edition
 
Introduction to (n)CQRS
Introduction to (n)CQRSIntroduction to (n)CQRS
Introduction to (n)CQRS
 
Lessons for developers
Lessons for developersLessons for developers
Lessons for developers
 
Rethink your architecture with CQRS
Rethink your architecture with CQRSRethink your architecture with CQRS
Rethink your architecture with CQRS
 
Domain Driven Design fundamentals
Domain Driven Design fundamentalsDomain Driven Design fundamentals
Domain Driven Design fundamentals
 
Introduction to Spec#
Introduction to Spec#Introduction to Spec#
Introduction to Spec#
 
C#, What Is Next?
C#, What Is Next?C#, What Is Next?
C#, What Is Next?
 
XNA presentation
XNA presentationXNA presentation
XNA presentation
 
Domain Driven Design In C#3.0
Domain Driven Design In C#3.0Domain Driven Design In C#3.0
Domain Driven Design In C#3.0
 

Introduction to CQRS