SlideShare a Scribd company logo
1 of 22
About CQRS & ES
Something about CQRS & Event Sourcing patterns
By trinhthethanh25390@gmail.com
- Problems
- Introduction to CQRS & Event Sourcing
- Apply the concepts
- Using Axon framework to implement an example
Outline
Problems - from a common search
215.000.000 results!!!
- Normalize database is hard, retrieving data from that is harder
Problems - from a common search
Which one is better?
- One of the principles of microservices is that a service should not directly
access another service's data store
Problems - to microservices architecture
Question: microservices multiple database challengers??
“CQRS is not a silver bullet...CQRS is not Event Sourcing...CQRS is not a good wife
...but...CQRS can open many doors”
CQRS
Greg Young
- Command Query Responsibility Segregation
- Separate the application into different models for Commands and Queries
CQRS - the concepts
- Command Query Responsibility Segregation
- Separate the application into different models for Commands and Queries
CQRS - the concepts
I want something done
Commands
- Command Query Responsibility Segregation
- Separate the application into different models for Commands and Queries
CQRS - the concepts
I want something done
Commands
I want to know something
Queries
- Command Query Responsibility Segregation
- Separate the application into different models for Commands and Queries
CQRS - the concepts
I want something done
Commands
I want to know something
Queries
UI
- Command Query Responsibility Segregation
- Separate the application into different models for Commands and Queries
- Event sourcing: what actually happened?
CQRS - the concepts
I want something done
Commands
I want to know something
Queries
UI
events
- Command Query Responsibility Segregation
- Separate the application into different models for Commands and Queries
- Event sourcing: what actually happened?
CQRS - the concepts
I want something done
Commands
I want to know something
Queries
UI
events
Event
store
CQRS - the flow
Image source:microsoft
CQRS - the components
Image source:geekabyte.io
Applying CQRS concept
- Use separate write/read model inside an application
Applying CQRS concept
- Use separate write/read model inside an application
Applying CQRS concept
- DB View (not bad)
- Spring JPA native query
@Query,
@NamedNativeQueries
- NoSQL/full text search store
for read side
- CQRS/ES based frameworks
- Axon framework
- Lagom framwork
- Eventuate ES
- ….
Applying CQRS concept
Example
https://github.com/3t-dev/cqrs-order-portfolio
Thank you!

More Related Content

Similar to Cqrs & event sourcing

Semantic technologies in practice - KULeuven 2016
Semantic technologies in practice - KULeuven 2016Semantic technologies in practice - KULeuven 2016
Semantic technologies in practice - KULeuven 2016Aad Versteden
 
Dot net interview questions
Dot net interview questionsDot net interview questions
Dot net interview questionsNetra Wable
 
Splice Machine's use of Apache Spark and MLflow
Splice Machine's use of Apache Spark and MLflowSplice Machine's use of Apache Spark and MLflow
Splice Machine's use of Apache Spark and MLflowDatabricks
 
Modern webtechnologies
Modern webtechnologiesModern webtechnologies
Modern webtechnologiesBesjan Xhika
 
CQRS: Command/Query Responsibility Segregation
CQRS: Command/Query Responsibility SegregationCQRS: Command/Query Responsibility Segregation
CQRS: Command/Query Responsibility SegregationBrian Ritchie
 
MongoDB Days UK: Building Apps with the MEAN Stack
MongoDB Days UK: Building Apps with the MEAN StackMongoDB Days UK: Building Apps with the MEAN Stack
MongoDB Days UK: Building Apps with the MEAN StackMongoDB
 
Better application architecture with #microservices and #BPM (as APaaS)
Better application architecture with #microservices and #BPM (as APaaS)Better application architecture with #microservices and #BPM (as APaaS)
Better application architecture with #microservices and #BPM (as APaaS)Alexander SAMARIN
 
Top 20 azure interview questions
Top 20 azure interview questionsTop 20 azure interview questions
Top 20 azure interview questionsShivamSharma909
 
IEEE SE2012 Internet-based self-services
IEEE SE2012 Internet-based self-servicesIEEE SE2012 Internet-based self-services
IEEE SE2012 Internet-based self-servicesJorge Cardoso
 
Microsoft azure interview questions
Microsoft azure interview questionsMicrosoft azure interview questions
Microsoft azure interview questionspkmsexchange
 
Models in Minutes using AutoML
Models in Minutes using AutoMLModels in Minutes using AutoML
Models in Minutes using AutoMLBill Liu
 
Better and Faster: A Journey Toward Clean Code and Enjoyment
Better and Faster: A Journey Toward Clean Code and EnjoymentBetter and Faster: A Journey Toward Clean Code and Enjoyment
Better and Faster: A Journey Toward Clean Code and EnjoymentChris Holland
 
Emerging Trends of Test automation - Talk in Software Testing Conference Nort...
Emerging Trends of Test automation - Talk in Software Testing Conference Nort...Emerging Trends of Test automation - Talk in Software Testing Conference Nort...
Emerging Trends of Test automation - Talk in Software Testing Conference Nort...Sriram Angajala
 

Similar to Cqrs & event sourcing (20)

MVC
MVCMVC
MVC
 
Semantic technologies in practice - KULeuven 2016
Semantic technologies in practice - KULeuven 2016Semantic technologies in practice - KULeuven 2016
Semantic technologies in practice - KULeuven 2016
 
Dot net interview questions
Dot net interview questionsDot net interview questions
Dot net interview questions
 
Splice Machine's use of Apache Spark and MLflow
Splice Machine's use of Apache Spark and MLflowSplice Machine's use of Apache Spark and MLflow
Splice Machine's use of Apache Spark and MLflow
 
Modern webtechnologies
Modern webtechnologiesModern webtechnologies
Modern webtechnologies
 
CQRS: Command/Query Responsibility Segregation
CQRS: Command/Query Responsibility SegregationCQRS: Command/Query Responsibility Segregation
CQRS: Command/Query Responsibility Segregation
 
Microservices why?
Microservices   why?Microservices   why?
Microservices why?
 
MongoDB Days UK: Building Apps with the MEAN Stack
MongoDB Days UK: Building Apps with the MEAN StackMongoDB Days UK: Building Apps with the MEAN Stack
MongoDB Days UK: Building Apps with the MEAN Stack
 
Better application architecture with #microservices and #BPM (as APaaS)
Better application architecture with #microservices and #BPM (as APaaS)Better application architecture with #microservices and #BPM (as APaaS)
Better application architecture with #microservices and #BPM (as APaaS)
 
NOS DevDays 2014 | CQRS+ES
NOS DevDays 2014 | CQRS+ESNOS DevDays 2014 | CQRS+ES
NOS DevDays 2014 | CQRS+ES
 
Top 20 azure interview questions
Top 20 azure interview questionsTop 20 azure interview questions
Top 20 azure interview questions
 
IEEE SE2012 Internet-based self-services
IEEE SE2012 Internet-based self-servicesIEEE SE2012 Internet-based self-services
IEEE SE2012 Internet-based self-services
 
Microsoft azure interview questions
Microsoft azure interview questionsMicrosoft azure interview questions
Microsoft azure interview questions
 
Models in Minutes using AutoML
Models in Minutes using AutoMLModels in Minutes using AutoML
Models in Minutes using AutoML
 
L23 Summary and Conclusions
L23 Summary and ConclusionsL23 Summary and Conclusions
L23 Summary and Conclusions
 
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
 
Better and Faster: A Journey Toward Clean Code and Enjoyment
Better and Faster: A Journey Toward Clean Code and EnjoymentBetter and Faster: A Journey Toward Clean Code and Enjoyment
Better and Faster: A Journey Toward Clean Code and Enjoyment
 
Emerging Trends of Test automation - Talk in Software Testing Conference Nort...
Emerging Trends of Test automation - Talk in Software Testing Conference Nort...Emerging Trends of Test automation - Talk in Software Testing Conference Nort...
Emerging Trends of Test automation - Talk in Software Testing Conference Nort...
 
Emerging5.0
Emerging5.0Emerging5.0
Emerging5.0
 
CQRS is not Event Sourcing
CQRS is not Event SourcingCQRS is not Event Sourcing
CQRS is not Event Sourcing
 

Recently uploaded

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 

Recently uploaded (20)

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 

Cqrs & event sourcing

  • 1. About CQRS & ES Something about CQRS & Event Sourcing patterns By trinhthethanh25390@gmail.com
  • 2. - Problems - Introduction to CQRS & Event Sourcing - Apply the concepts - Using Axon framework to implement an example Outline
  • 3. Problems - from a common search 215.000.000 results!!!
  • 4. - Normalize database is hard, retrieving data from that is harder Problems - from a common search Which one is better?
  • 5. - One of the principles of microservices is that a service should not directly access another service's data store Problems - to microservices architecture
  • 6.
  • 7. Question: microservices multiple database challengers??
  • 8. “CQRS is not a silver bullet...CQRS is not Event Sourcing...CQRS is not a good wife ...but...CQRS can open many doors” CQRS Greg Young
  • 9. - Command Query Responsibility Segregation - Separate the application into different models for Commands and Queries CQRS - the concepts
  • 10. - Command Query Responsibility Segregation - Separate the application into different models for Commands and Queries CQRS - the concepts I want something done Commands
  • 11. - Command Query Responsibility Segregation - Separate the application into different models for Commands and Queries CQRS - the concepts I want something done Commands I want to know something Queries
  • 12. - Command Query Responsibility Segregation - Separate the application into different models for Commands and Queries CQRS - the concepts I want something done Commands I want to know something Queries UI
  • 13. - Command Query Responsibility Segregation - Separate the application into different models for Commands and Queries - Event sourcing: what actually happened? CQRS - the concepts I want something done Commands I want to know something Queries UI events
  • 14. - Command Query Responsibility Segregation - Separate the application into different models for Commands and Queries - Event sourcing: what actually happened? CQRS - the concepts I want something done Commands I want to know something Queries UI events Event store
  • 15. CQRS - the flow Image source:microsoft
  • 16. CQRS - the components Image source:geekabyte.io
  • 18. - Use separate write/read model inside an application Applying CQRS concept
  • 19. - Use separate write/read model inside an application Applying CQRS concept - DB View (not bad) - Spring JPA native query @Query, @NamedNativeQueries - NoSQL/full text search store for read side
  • 20. - CQRS/ES based frameworks - Axon framework - Lagom framwork - Eventuate ES - …. Applying CQRS concept