SlideShare uma empresa Scribd logo
1 de 47
Baixar para ler offline
CQRS
from the trenches
Welcome!
Outline
Terms & Architecture
Reads & Writes
State [+ demo]
Event Sourcing & Replay [+ demo]
CQRS - from the trenches
General evaluation
Terms
CQRS - Command, Query Responsibility
Segregation (Greg Young, Udi Dahan)
Segregate operations that read data from operations
that update data by using separate interfaces.
CQS - Command, Query Separation (Bertrand
Meyer, OOSC, 1988)
A method should either change the state of an object,
or return a result, but not both.
WHY?!?!?
Terms
Command - something the system has to do.
It's a combination of expressed intent (which
describes what you want to do) as well as the
information required to take action based on that
intent.
Examples: LoginUser or AddToCart or StartMachine.
Terms
Query - a question or a request for information
about something.
Examples: getAllUsers, listAllItemsInCart,
getCurrentMachineState.
Architecture
Architecture
Architecture
Architecture
Architecture & Terms
Reads & Writes
Reads & Writes
Reads & Writes
Reads & Writes
Reads & Writes
CQS - Command, Query Separation (Bertrand
Meyer, OOSC, 1988)
A method should either change the state of an object,
or return a result, but not both.
Commands
Queries
Demo
State
State
Terms
Event - Describes something that has occurred in
the application.
Events loosely couple all components in your
application together.
Examples: UserLoggedIn, ItemAddedToCart, or
MachineStarted.
Architecture & Terms
Event Sourcing
Event Sourcing
Add Item CheckoutRemove Item
Event Sourcing
Event Sourcing
Event Sourcing
Demo
Event Sourcing
from the trenches
Feedback
REST mismatch
UI consequences
Set Validation
Duplication
Iterative Dev & Maintenance
Event sourcing and deletion
Learning Curve
CQRS = like an Onion!
When should you use it?
• Application is likely to be extended with new
functionality over a long period of time
• Application has a high read-to-write ratio
• Application presents data in many different formats
• Application has clearly separated components with
different audiences
When not to use it?
“The answer is most of the time.” - Udi Dahan
Take away
CQRS links
• CQRS starters kit - http://cqrs.nu/
• Udi Dahan - Clarified CQRS - http://www.udidahan.com/2009/12/09/clarified-cqrs/
• Udi Dahan - When to avoid CQRS - http://www.udidahan.com/2011/04/22/when-to-avoid-cqrs/
• Udi Dahan - Race Conditions don't exist - http://www.udidahan.com/2010/08/31/race-conditions-
dont-exist/
• Udi Dahan - Don't create aggregate roots - http://www.udidahan.com/2009/06/29/dont-create-
aggregate-roots/
• Rob Ashton - CQRS is too complicated - http://codeofrob.com/entries/cqrs-is-too-
complicated.html
• Greg Young - CQRS, Task Based UIs, Event Sourcing agh! - http://codebetter.com/gregyoung/
2010/02/16/cqrs-task-based-uis-event-sourcing-agh/
• Greg Young - CQRS Document - http://cqrs.files.wordpress.com/2010/11/cqrs_documents.pdf
• Greg Young - CQRS presentation - http://www.slideshare.net/lgrosales/greg-youngs-simple-
cqrs-sample-15519735
• Martin Fowler - CQRS - http://martinfowler.com/bliki/CQRS.html
• MSDN - CQRS Journey - http://msdn.microsoft.com/en-us/library/jj554200.aspx
• Structural Overview of a CQRS application - https://code.google.com/p/axon-auction-example/
wiki/StructuralOverview
Axon Framework links
• The Axon framework - http://www.axonframework.org/
• InfoQ - A discussion with Allard Buijze on CQRS with the Axon framework - http://
www.infoq.com/articles/cqrs_with_axon_framework
• Joris Kuipers & Allard Buijze - Scaling in Complex Domains using CQRS, Axon, and Spring
Insight - http://blogs.vmware.com/management/2013/02/scaling-in-complex-domains-using-cqrs-
axon-and-spring-insight.html
Example project links
• Axon-Auction-Example - https://code.google.com/p/axon-auction-example/wiki/
StructuralOverview
• Axon & Angular (2012) - http://blog.trifork.com/2012/11/27/basic-axon-framework-sample-using-
vert-x-and-angular-js/
• Axon Framework + Quickstart - https://github.com/AxonFramework/AxonFramework
• Axon Trader - https://github.com/AxonFramework/Axon-trader
• Axon Addressbook Sample - https://github.com/AxonFramework/Addressbook-Sample
• Motown project (IHomer) - Axon - https://github.com/motown-io/motown

Mais conteúdo relacionado

Semelhante a CQRS Architecture and Event Sourcing Explained

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 Developerswojtek_s
 
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...Eric D. Boyd
 
Alex mang patterns for scalability in microsoft azure application
Alex mang   patterns for scalability in microsoft azure applicationAlex mang   patterns for scalability in microsoft azure application
Alex mang patterns for scalability in microsoft azure applicationCodecamp Romania
 
Being RDBMS Free -- Alternate Approaches to Data Persistence
Being RDBMS Free -- Alternate Approaches to Data PersistenceBeing RDBMS Free -- Alternate Approaches to Data Persistence
Being RDBMS Free -- Alternate Approaches to Data PersistenceDavid Hoerster
 
How Lucene Powers the LinkedIn Segmentation and Targeting Platform
How Lucene Powers the LinkedIn Segmentation and Targeting PlatformHow Lucene Powers the LinkedIn Segmentation and Targeting Platform
How Lucene Powers the LinkedIn Segmentation and Targeting Platformlucenerevolution
 
Data Structure and Algorithms
Data Structure and AlgorithmsData Structure and Algorithms
Data Structure and Algorithmsiqbalphy1
 
ADL/U-SQL Introduction (SQLBits 2016)
ADL/U-SQL Introduction (SQLBits 2016)ADL/U-SQL Introduction (SQLBits 2016)
ADL/U-SQL Introduction (SQLBits 2016)Michael Rys
 
Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014 Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014 Uri Cohen
 
Workshop - cqrs brief introduction
Workshop - cqrs brief introductionWorkshop - cqrs brief introduction
Workshop - cqrs brief introductionFrancesco Garavaglia
 
What is Web-scraping?
What is Web-scraping?What is Web-scraping?
What is Web-scraping?Yu-Chang Ho
 
October 2014 - USG Rock Eagle - Drupal 101
October 2014 - USG Rock Eagle - Drupal 101October 2014 - USG Rock Eagle - Drupal 101
October 2014 - USG Rock Eagle - Drupal 101Eric Sembrat
 
Database Systems - Lecture Week 1
Database Systems - Lecture Week 1Database Systems - Lecture Week 1
Database Systems - Lecture Week 1Dios Kurniawan
 
SOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBSOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBUniFabric
 
LRT MoodleMootUK11 Unconf Presentation
LRT MoodleMootUK11 Unconf PresentationLRT MoodleMootUK11 Unconf Presentation
LRT MoodleMootUK11 Unconf PresentationSteve Nisbet
 
Design | expose ap is with cqrs
Design | expose ap is with cqrsDesign | expose ap is with cqrs
Design | expose ap is with cqrselazhiA
 
Azure presentation nnug dec 2010
Azure presentation nnug  dec 2010Azure presentation nnug  dec 2010
Azure presentation nnug dec 2010Ethos Technologies
 
Building Powerful and Intelligent Applications with Azure Machine Learning
Building Powerful and Intelligent Applications with Azure Machine LearningBuilding Powerful and Intelligent Applications with Azure Machine Learning
Building Powerful and Intelligent Applications with Azure Machine LearningDavid Walker, CSM,CSD,MCP,MCAD,MCSD,MVP
 
The Business Case for Semantic Web Ontology & Knowledge Graph
The Business Case for Semantic Web Ontology & Knowledge GraphThe Business Case for Semantic Web Ontology & Knowledge Graph
The Business Case for Semantic Web Ontology & Knowledge GraphCambridge Semantics
 
Unify service and ui layer automation bdd way.pptx (1)
Unify service and ui layer automation bdd way.pptx (1)Unify service and ui layer automation bdd way.pptx (1)
Unify service and ui layer automation bdd way.pptx (1)Shivaling Sannalli
 

Semelhante a CQRS Architecture and Event Sourcing Explained (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
 
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
 
Alex mang patterns for scalability in microsoft azure application
Alex mang   patterns for scalability in microsoft azure applicationAlex mang   patterns for scalability in microsoft azure application
Alex mang patterns for scalability in microsoft azure application
 
Being RDBMS Free -- Alternate Approaches to Data Persistence
Being RDBMS Free -- Alternate Approaches to Data PersistenceBeing RDBMS Free -- Alternate Approaches to Data Persistence
Being RDBMS Free -- Alternate Approaches to Data Persistence
 
How Lucene Powers the LinkedIn Segmentation and Targeting Platform
How Lucene Powers the LinkedIn Segmentation and Targeting PlatformHow Lucene Powers the LinkedIn Segmentation and Targeting Platform
How Lucene Powers the LinkedIn Segmentation and Targeting Platform
 
Data Structure and Algorithms
Data Structure and AlgorithmsData Structure and Algorithms
Data Structure and Algorithms
 
ADL/U-SQL Introduction (SQLBits 2016)
ADL/U-SQL Introduction (SQLBits 2016)ADL/U-SQL Introduction (SQLBits 2016)
ADL/U-SQL Introduction (SQLBits 2016)
 
Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014 Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014
 
Workshop - cqrs brief introduction
Workshop - cqrs brief introductionWorkshop - cqrs brief introduction
Workshop - cqrs brief introduction
 
What is Web-scraping?
What is Web-scraping?What is Web-scraping?
What is Web-scraping?
 
October 2014 - USG Rock Eagle - Drupal 101
October 2014 - USG Rock Eagle - Drupal 101October 2014 - USG Rock Eagle - Drupal 101
October 2014 - USG Rock Eagle - Drupal 101
 
Database Systems - Lecture Week 1
Database Systems - Lecture Week 1Database Systems - Lecture Week 1
Database Systems - Lecture Week 1
 
SOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBSOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DB
 
LRT MoodleMootUK11 Unconf Presentation
LRT MoodleMootUK11 Unconf PresentationLRT MoodleMootUK11 Unconf Presentation
LRT MoodleMootUK11 Unconf Presentation
 
Design | expose ap is with cqrs
Design | expose ap is with cqrsDesign | expose ap is with cqrs
Design | expose ap is with cqrs
 
Collab365 Empower-Your-Applications-With-Azure-Machine-Learning
Collab365 Empower-Your-Applications-With-Azure-Machine-LearningCollab365 Empower-Your-Applications-With-Azure-Machine-Learning
Collab365 Empower-Your-Applications-With-Azure-Machine-Learning
 
Azure presentation nnug dec 2010
Azure presentation nnug  dec 2010Azure presentation nnug  dec 2010
Azure presentation nnug dec 2010
 
Building Powerful and Intelligent Applications with Azure Machine Learning
Building Powerful and Intelligent Applications with Azure Machine LearningBuilding Powerful and Intelligent Applications with Azure Machine Learning
Building Powerful and Intelligent Applications with Azure Machine Learning
 
The Business Case for Semantic Web Ontology & Knowledge Graph
The Business Case for Semantic Web Ontology & Knowledge GraphThe Business Case for Semantic Web Ontology & Knowledge Graph
The Business Case for Semantic Web Ontology & Knowledge Graph
 
Unify service and ui layer automation bdd way.pptx (1)
Unify service and ui layer automation bdd way.pptx (1)Unify service and ui layer automation bdd way.pptx (1)
Unify service and ui layer automation bdd way.pptx (1)
 

Mais de nextbuild

Aws microservice keynote
Aws microservice keynoteAws microservice keynote
Aws microservice keynotenextbuild
 
How invariants help writing loops
How invariants help writing loopsHow invariants help writing loops
How invariants help writing loopsnextbuild
 
A first taste of integration with Apache Camel
A first taste of integration with Apache CamelA first taste of integration with Apache Camel
A first taste of integration with Apache Camelnextbuild
 
Effective code reviews
Effective code reviewsEffective code reviews
Effective code reviewsnextbuild
 
Microservices in the real world
Microservices in the real worldMicroservices in the real world
Microservices in the real worldnextbuild
 
Asp.net in a new world
Asp.net in a new worldAsp.net in a new world
Asp.net in a new worldnextbuild
 
Meteor - building an email client
Meteor - building an email clientMeteor - building an email client
Meteor - building an email clientnextbuild
 
Swimming upstream in the container revolution
Swimming upstream in the container revolutionSwimming upstream in the container revolution
Swimming upstream in the container revolutionnextbuild
 
Event sourcing your AngularJS applications
Event sourcing your AngularJS applicationsEvent sourcing your AngularJS applications
Event sourcing your AngularJS applicationsnextbuild
 
Make color schemes a no brainer with sass
Make color schemes a no brainer with sassMake color schemes a no brainer with sass
Make color schemes a no brainer with sassnextbuild
 
Architecting for the cloud
Architecting for the cloudArchitecting for the cloud
Architecting for the cloudnextbuild
 
Finally… reliable software!
Finally… reliable software!Finally… reliable software!
Finally… reliable software!nextbuild
 
Cucumber spec - a tool takes your bdd to the next level
Cucumber spec - a tool takes your bdd to the next levelCucumber spec - a tool takes your bdd to the next level
Cucumber spec - a tool takes your bdd to the next levelnextbuild
 

Mais de nextbuild (13)

Aws microservice keynote
Aws microservice keynoteAws microservice keynote
Aws microservice keynote
 
How invariants help writing loops
How invariants help writing loopsHow invariants help writing loops
How invariants help writing loops
 
A first taste of integration with Apache Camel
A first taste of integration with Apache CamelA first taste of integration with Apache Camel
A first taste of integration with Apache Camel
 
Effective code reviews
Effective code reviewsEffective code reviews
Effective code reviews
 
Microservices in the real world
Microservices in the real worldMicroservices in the real world
Microservices in the real world
 
Asp.net in a new world
Asp.net in a new worldAsp.net in a new world
Asp.net in a new world
 
Meteor - building an email client
Meteor - building an email clientMeteor - building an email client
Meteor - building an email client
 
Swimming upstream in the container revolution
Swimming upstream in the container revolutionSwimming upstream in the container revolution
Swimming upstream in the container revolution
 
Event sourcing your AngularJS applications
Event sourcing your AngularJS applicationsEvent sourcing your AngularJS applications
Event sourcing your AngularJS applications
 
Make color schemes a no brainer with sass
Make color schemes a no brainer with sassMake color schemes a no brainer with sass
Make color schemes a no brainer with sass
 
Architecting for the cloud
Architecting for the cloudArchitecting for the cloud
Architecting for the cloud
 
Finally… reliable software!
Finally… reliable software!Finally… reliable software!
Finally… reliable software!
 
Cucumber spec - a tool takes your bdd to the next level
Cucumber spec - a tool takes your bdd to the next levelCucumber spec - a tool takes your bdd to the next level
Cucumber spec - a tool takes your bdd to the next level
 

Último

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 

Último (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

CQRS Architecture and Event Sourcing Explained

  • 3. Outline Terms & Architecture Reads & Writes State [+ demo] Event Sourcing & Replay [+ demo] CQRS - from the trenches General evaluation
  • 4. Terms CQRS - Command, Query Responsibility Segregation (Greg Young, Udi Dahan) Segregate operations that read data from operations that update data by using separate interfaces. CQS - Command, Query Separation (Bertrand Meyer, OOSC, 1988) A method should either change the state of an object, or return a result, but not both.
  • 6. Terms Command - something the system has to do. It's a combination of expressed intent (which describes what you want to do) as well as the information required to take action based on that intent. Examples: LoginUser or AddToCart or StartMachine.
  • 7. Terms Query - a question or a request for information about something. Examples: getAllUsers, listAllItemsInCart, getCurrentMachineState.
  • 17. Reads & Writes CQS - Command, Query Separation (Bertrand Meyer, OOSC, 1988) A method should either change the state of an object, or return a result, but not both.
  • 20. Demo
  • 21. State
  • 22. State
  • 23. Terms Event - Describes something that has occurred in the application. Events loosely couple all components in your application together. Examples: UserLoggedIn, ItemAddedToCart, or MachineStarted.
  • 26. Event Sourcing Add Item CheckoutRemove Item
  • 30. Demo
  • 38. Iterative Dev & Maintenance
  • 39. Event sourcing and deletion
  • 41. CQRS = like an Onion!
  • 42. When should you use it? • Application is likely to be extended with new functionality over a long period of time • Application has a high read-to-write ratio • Application presents data in many different formats • Application has clearly separated components with different audiences
  • 43. When not to use it? “The answer is most of the time.” - Udi Dahan
  • 45. CQRS links • CQRS starters kit - http://cqrs.nu/ • Udi Dahan - Clarified CQRS - http://www.udidahan.com/2009/12/09/clarified-cqrs/ • Udi Dahan - When to avoid CQRS - http://www.udidahan.com/2011/04/22/when-to-avoid-cqrs/ • Udi Dahan - Race Conditions don't exist - http://www.udidahan.com/2010/08/31/race-conditions- dont-exist/ • Udi Dahan - Don't create aggregate roots - http://www.udidahan.com/2009/06/29/dont-create- aggregate-roots/ • Rob Ashton - CQRS is too complicated - http://codeofrob.com/entries/cqrs-is-too- complicated.html • Greg Young - CQRS, Task Based UIs, Event Sourcing agh! - http://codebetter.com/gregyoung/ 2010/02/16/cqrs-task-based-uis-event-sourcing-agh/ • Greg Young - CQRS Document - http://cqrs.files.wordpress.com/2010/11/cqrs_documents.pdf • Greg Young - CQRS presentation - http://www.slideshare.net/lgrosales/greg-youngs-simple- cqrs-sample-15519735 • Martin Fowler - CQRS - http://martinfowler.com/bliki/CQRS.html • MSDN - CQRS Journey - http://msdn.microsoft.com/en-us/library/jj554200.aspx • Structural Overview of a CQRS application - https://code.google.com/p/axon-auction-example/ wiki/StructuralOverview
  • 46. Axon Framework links • The Axon framework - http://www.axonframework.org/ • InfoQ - A discussion with Allard Buijze on CQRS with the Axon framework - http:// www.infoq.com/articles/cqrs_with_axon_framework • Joris Kuipers & Allard Buijze - Scaling in Complex Domains using CQRS, Axon, and Spring Insight - http://blogs.vmware.com/management/2013/02/scaling-in-complex-domains-using-cqrs- axon-and-spring-insight.html
  • 47. Example project links • Axon-Auction-Example - https://code.google.com/p/axon-auction-example/wiki/ StructuralOverview • Axon & Angular (2012) - http://blog.trifork.com/2012/11/27/basic-axon-framework-sample-using- vert-x-and-angular-js/ • Axon Framework + Quickstart - https://github.com/AxonFramework/AxonFramework • Axon Trader - https://github.com/AxonFramework/Axon-trader • Axon Addressbook Sample - https://github.com/AxonFramework/Addressbook-Sample • Motown project (IHomer) - Axon - https://github.com/motown-io/motown