SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Downloaden Sie, um offline zu lesen
CQ(R)S
Command-Query Responsibility Segregation
The typical CRUD architecture
http://en.wikipedia.org/wiki/Multitier_architecture
Command and Query Soup
• MVC application: POST includes a command (intent to act) and
returns a view based on a query.
• That doesn’t mean commands can’t have replies.
Replies are in the form of “sure, I’ll do that” or “no problem, done”
Command Query Separation (CQS)
• Queries: Return a result and do not change the observable state of
the system (are free of side effects).
• Commands: Change the state of a system but do not return a value.
Bertrand Meyer
More buzz words
• Domain Driven Design
• Event/Message Based design
• Distributed Applications
• EventSourcing
• Test Driven Development
Different kinds of ‘RS’
• EventSourcing + Reporting DB
• Different ViewModels for read and create/update (client level)
• Different databases or tables/views for read or write (DB level)
• …
The hexagonal architecture
http://alistair.cockburn.us/Hexagonal+architecture
Uncle Bob’s “Clean Architecture”
http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html
Examples & Sources
• CQRS Journey
http://msdn.microsoft.com/en-us/library/jj554200.aspx
• CQRS, the book (Mark Nijhof)
https://github.com/MarkNijhof/Fohjin
• Lokad-CQRS
https://github.com/lokad/lokad-cqrs/
• CQRS (Martin Fowler)
http://martinfowler.com/bliki/CQRS.html
• Clarified CQRS (Udi Dahan)
http://www.udidahan.com/2009/12/09/clarified-cqrs/
Java Options
• Qi4j (framework for domain-centric application development)
http://qi4j.org/
• Axon Framework (cqrs framework)
http://www.axonframework.org/
• ServiceMix
http://servicemix.apache.org/
• Don’t forget the roll-your-own-KISS-YAGNI solution!
Demo Technology Stack
• Topshelf
• NServiceBus
• NancyFx
• OWIN
Cqrs intro

Weitere ähnliche Inhalte

Was ist angesagt?

Mvc pattern and implementation in java fair
Mvc   pattern   and implementation   in   java fairMvc   pattern   and implementation   in   java fair
Mvc pattern and implementation in java fair
Tech_MX
 

Was ist angesagt? (19)

PAC
PACPAC
PAC
 
Java Development Environment
Java Development EnvironmentJava Development Environment
Java Development Environment
 
Database component in mule
Database component in muleDatabase component in mule
Database component in mule
 
RES Wisdom 2009 training day2
RES Wisdom 2009 training day2RES Wisdom 2009 training day2
RES Wisdom 2009 training day2
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuning
 
Android Data Binding Support Library
Android Data Binding Support LibraryAndroid Data Binding Support Library
Android Data Binding Support Library
 
MVC Architecture
MVC ArchitectureMVC Architecture
MVC Architecture
 
Struts(mrsurwar) ppt
Struts(mrsurwar) pptStruts(mrsurwar) ppt
Struts(mrsurwar) ppt
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
Cara v3.6 released - major new features
Cara v3.6 released - major new featuresCara v3.6 released - major new features
Cara v3.6 released - major new features
 
Mvc pattern and implementation in java fair
Mvc   pattern   and implementation   in   java fairMvc   pattern   and implementation   in   java fair
Mvc pattern and implementation in java fair
 
SQL Server Service Broker – A Competent Architecture by Microsoft
SQL Server Service Broker – A Competent Architecture by MicrosoftSQL Server Service Broker – A Competent Architecture by Microsoft
SQL Server Service Broker – A Competent Architecture by Microsoft
 
Real-world software design practices when developing ASP.NET web systems by B...
Real-world software design practices when developing ASP.NET web systems by B...Real-world software design practices when developing ASP.NET web systems by B...
Real-world software design practices when developing ASP.NET web systems by B...
 
Vertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UG
Vertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UGVertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UG
Vertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UG
 
MVC Framework
MVC FrameworkMVC Framework
MVC Framework
 
Mule anypoint data gateway
Mule  anypoint data gatewayMule  anypoint data gateway
Mule anypoint data gateway
 
Anypoint connector dev kit
Anypoint connector dev kitAnypoint connector dev kit
Anypoint connector dev kit
 
Model View Controller (MVC)
Model View Controller (MVC)Model View Controller (MVC)
Model View Controller (MVC)
 
MVC architecture by Mohd.Awais on 18th Aug, 2017
MVC architecture by Mohd.Awais on 18th Aug, 2017MVC architecture by Mohd.Awais on 18th Aug, 2017
MVC architecture by Mohd.Awais on 18th Aug, 2017
 

Ähnlich wie Cqrs intro

Борис Трофимов. Continuous Database migration-это просто!
Борис Трофимов. Continuous Database migration-это просто!Борис Трофимов. Continuous Database migration-это просто!
Борис Трофимов. Continuous Database migration-это просто!
Volha Banadyseva
 
Be05 introduction to sql azure
Be05   introduction to sql azureBe05   introduction to sql azure
Be05 introduction to sql azure
DotNetCampus
 
World2016_T5_S5_SQLServerFunctionalOverview
World2016_T5_S5_SQLServerFunctionalOverviewWorld2016_T5_S5_SQLServerFunctionalOverview
World2016_T5_S5_SQLServerFunctionalOverview
Farah Omer
 
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 EditionEnter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
Mark Broadbent
 

Ähnlich wie Cqrs intro (20)

Microsoft SQL Server Continuous Integration
Microsoft SQL Server Continuous IntegrationMicrosoft SQL Server Continuous Integration
Microsoft SQL Server Continuous Integration
 
Continuous DB migration based on carbon5 framework
Continuous DB migration based on carbon5 frameworkContinuous DB migration based on carbon5 framework
Continuous DB migration based on carbon5 framework
 
Борис Трофимов. Continuous Database migration-это просто!
Борис Трофимов. Continuous Database migration-это просто!Борис Трофимов. Continuous Database migration-это просто!
Борис Трофимов. Continuous Database migration-это просто!
 
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginnersSQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
 
MVC + ORM (with project implementation)
MVC + ORM (with project implementation)MVC + ORM (with project implementation)
MVC + ORM (with project implementation)
 
Be05 introduction to sql azure
Be05   introduction to sql azureBe05   introduction to sql azure
Be05 introduction to sql azure
 
Moves Like Jagger - Upgrading to SQL Server 2012 (SQLBits XI Edition)
Moves Like Jagger - Upgrading to SQL Server 2012 (SQLBits XI Edition)Moves Like Jagger - Upgrading to SQL Server 2012 (SQLBits XI Edition)
Moves Like Jagger - Upgrading to SQL Server 2012 (SQLBits XI Edition)
 
Day2
Day2Day2
Day2
 
Mobile
MobileMobile
Mobile
 
Evolutionary Database Design
Evolutionary Database DesignEvolutionary Database Design
Evolutionary Database Design
 
Efficient working with Databases in LabVIEW - Sam Sharp (MediaMongrels Ltd) -...
Efficient working with Databases in LabVIEW - Sam Sharp (MediaMongrels Ltd) -...Efficient working with Databases in LabVIEW - Sam Sharp (MediaMongrels Ltd) -...
Efficient working with Databases in LabVIEW - Sam Sharp (MediaMongrels Ltd) -...
 
New features of sql server 2016 bi features
New features of sql server 2016 bi featuresNew features of sql server 2016 bi features
New features of sql server 2016 bi features
 
Praveen Kumar Resume
Praveen Kumar ResumePraveen Kumar Resume
Praveen Kumar Resume
 
A Primer To Sybase Iq Development July 13
A Primer To Sybase Iq Development July 13A Primer To Sybase Iq Development July 13
A Primer To Sybase Iq Development July 13
 
World2016_T5_S5_SQLServerFunctionalOverview
World2016_T5_S5_SQLServerFunctionalOverviewWorld2016_T5_S5_SQLServerFunctionalOverview
World2016_T5_S5_SQLServerFunctionalOverview
 
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 EditionEnter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
 
Rapid SQL Datasheet - The Intelligent IDE for SQL Development
Rapid SQL Datasheet - The Intelligent IDE for SQL DevelopmentRapid SQL Datasheet - The Intelligent IDE for SQL Development
Rapid SQL Datasheet - The Intelligent IDE for SQL Development
 
CQRS and what it means for your architecture
CQRS and what it means for your architectureCQRS and what it means for your architecture
CQRS and what it means for your architecture
 
Rock Solid SQL Server Management
Rock Solid SQL Server ManagementRock Solid SQL Server Management
Rock Solid SQL Server Management
 
Web App Architectures and Design Patterns
Web App Architectures and Design PatternsWeb App Architectures and Design Patterns
Web App Architectures and Design Patterns
 

Mehr von E2 Partners

Mehr von E2 Partners (11)

API Management systems - the good the bad & the ugly
API Management systems - the good the bad & the uglyAPI Management systems - the good the bad & the ugly
API Management systems - the good the bad & the ugly
 
Angular js
Angular jsAngular js
Angular js
 
Big data hype or reality
Big data   hype or realityBig data   hype or reality
Big data hype or reality
 
Te²d talks pair programming
Te²d talks   pair programmingTe²d talks   pair programming
Te²d talks pair programming
 
Time management
Time managementTime management
Time management
 
Every1 can innovate
Every1 can innovateEvery1 can innovate
Every1 can innovate
 
Here 2 help you ;)
Here 2 help you ;)Here 2 help you ;)
Here 2 help you ;)
 
Pragmatic Enterprise Architecture
Pragmatic Enterprise ArchitecturePragmatic Enterprise Architecture
Pragmatic Enterprise Architecture
 
Windows Azure
Windows AzureWindows Azure
Windows Azure
 
Building responsive websites
Building responsive websitesBuilding responsive websites
Building responsive websites
 
2 improve - An improvement track for your company
2 improve - An improvement track for your company2 improve - An improvement track for your company
2 improve - An improvement track for your company
 

Kürzlich hochgeladen

Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Kürzlich hochgeladen (20)

WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
 
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 

Cqrs intro

  • 2. The typical CRUD architecture http://en.wikipedia.org/wiki/Multitier_architecture
  • 3. Command and Query Soup • MVC application: POST includes a command (intent to act) and returns a view based on a query. • That doesn’t mean commands can’t have replies. Replies are in the form of “sure, I’ll do that” or “no problem, done”
  • 4. Command Query Separation (CQS) • Queries: Return a result and do not change the observable state of the system (are free of side effects). • Commands: Change the state of a system but do not return a value. Bertrand Meyer
  • 5.
  • 6.
  • 7.
  • 8. More buzz words • Domain Driven Design • Event/Message Based design • Distributed Applications • EventSourcing • Test Driven Development
  • 9. Different kinds of ‘RS’ • EventSourcing + Reporting DB • Different ViewModels for read and create/update (client level) • Different databases or tables/views for read or write (DB level) • …
  • 11. Uncle Bob’s “Clean Architecture” http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html
  • 12. Examples & Sources • CQRS Journey http://msdn.microsoft.com/en-us/library/jj554200.aspx • CQRS, the book (Mark Nijhof) https://github.com/MarkNijhof/Fohjin • Lokad-CQRS https://github.com/lokad/lokad-cqrs/ • CQRS (Martin Fowler) http://martinfowler.com/bliki/CQRS.html • Clarified CQRS (Udi Dahan) http://www.udidahan.com/2009/12/09/clarified-cqrs/
  • 13. Java Options • Qi4j (framework for domain-centric application development) http://qi4j.org/ • Axon Framework (cqrs framework) http://www.axonframework.org/ • ServiceMix http://servicemix.apache.org/ • Don’t forget the roll-your-own-KISS-YAGNI solution!
  • 14. Demo Technology Stack • Topshelf • NServiceBus • NancyFx • OWIN