SlideShare a Scribd company logo
1 of 17
PageUp People
CQRS and
Eventing
Sourcing
Abhaya Chauhan
@AbhayaChauhan
Data Modelling - Third Normal
Form
Performance with 3NF
❖ Launching brand new product
❖ 000s hits per second
Products
Product
Comments
Product Reviews
Product Inventory Best Sellers
Losing data
❖ Who said it was okay to remove data?
User Shopping Cart
User Id Product Quantity
1
Tennis
Racquet
1
1
Samsung
Note 3
1
1 30” Monitor 2
DELETE FROM UserShoppingCart
WHERE Product = ’30” Monitor’
Audit / History Logs
AccountId Balance When
1234 0
01 Jan
2015
1234 1000
05 Jan
2015
AccountId Balance
1234 $1000
Trigger /
Event
Based /
Explicit
Account Account History
Event Sourced Shopping Cart
Cart
Created
3 Items
Added
1 Item
Removed
Checked
Out
WRITE SIDE
Task Based UI Projection
READ SIDE
Advantages of Event Sourcing
❖ Fantastic Performance
❖ Events are appended only - forward only.
❖ Allows our query model to be custom made for each Task Based UI
❖ Events are immutable
❖ Very easy to scale up
❖ Easier to test
❖ Reply events to replicate issues
❖ Smoke test - Rerun REAL production scenarios
❖ Business Value - allows you to analyse behaviour and events
❖ Not limited to “current state”
Standard Application
Architecture
Command Query Responsibility
Segregation
Eventual Consistency
❖ Eventual Consistency sounds bad
❖ But in reality, most of us are dealing with it without realising.
❖ Part of distributed computing - CAP Theorem
❖ Consistency
❖ System Availability
❖ Network Partitioning
❖ Many ways to handle it
Task Based UI
❖ a.k.a Inductive UIs
❖ Opposite to CRUD UI
❖ User Interface should be presented in terms of the problem
domain
❖ Example
❖ User Interface should be presented for one task, in a clear
fashion
❖ Works well with Domain Driven Design
❖ Helps in naming Commands / Requests (Queries)
Event Driven Architecture
❖ This is a top level architecture pattern
❖ Domain events are published
❖ Anyone can subscribe to them
❖ Medium - Message Bus
❖ Execute a loosely coupled, cross system workflow
CQRS and Eventing Sourcing
CQRS and Eventing Sourcing
CQRS and Eventing Sourcing

More Related Content

Viewers also liked

komodo dan tambang emas
komodo dan tambang emaskomodo dan tambang emas
komodo dan tambang emas
Rini Sucahyo
 
Indicadores compostos para medir o grau de desenvolvimento dos países ficha...
Indicadores compostos para medir o grau de desenvolvimento dos países   ficha...Indicadores compostos para medir o grau de desenvolvimento dos países   ficha...
Indicadores compostos para medir o grau de desenvolvimento dos países ficha...
Ana Santos
 

Viewers also liked (14)

Break Through Agile Transformation Stagnation
Break Through Agile Transformation StagnationBreak Through Agile Transformation Stagnation
Break Through Agile Transformation Stagnation
 
komodo dan tambang emas
komodo dan tambang emaskomodo dan tambang emas
komodo dan tambang emas
 
Resumen de Historia de la Arquitectura
Resumen de Historia de la ArquitecturaResumen de Historia de la Arquitectura
Resumen de Historia de la Arquitectura
 
DESS
DESSDESS
DESS
 
Informativo nº 1 1º básico b semana 06 al 10 de marzo
Informativo nº 1   1º básico b semana 06 al 10 de marzoInformativo nº 1   1º básico b semana 06 al 10 de marzo
Informativo nº 1 1º básico b semana 06 al 10 de marzo
 
4º básico b semana 13 al 17 de marzo
4º básico b semana 13 al 17 de marzo4º básico b semana 13 al 17 de marzo
4º básico b semana 13 al 17 de marzo
 
2º básico b semana 13 al 17 de marzo
2º básico b  semana 13 al 17 de marzo2º básico b  semana 13 al 17 de marzo
2º básico b semana 13 al 17 de marzo
 
Informativo nº 1 1º básico c semana 06 al 10 de marzo
Informativo nº 1   1º básico c  semana 06 al 10 de marzoInformativo nº 1   1º básico c  semana 06 al 10 de marzo
Informativo nº 1 1º básico c semana 06 al 10 de marzo
 
Informativo nº 1 4º básico a semana 06 al 10 de marzo
Informativo nº 1   4º básico a semana 06 al 10 de marzoInformativo nº 1   4º básico a semana 06 al 10 de marzo
Informativo nº 1 4º básico a semana 06 al 10 de marzo
 
4º básico a semana 13 al 16 de marzo
4º básico a semana 13 al 16 de marzo4º básico a semana 13 al 16 de marzo
4º básico a semana 13 al 16 de marzo
 
Indicadores compostos para medir o grau de desenvolvimento dos países ficha...
Indicadores compostos para medir o grau de desenvolvimento dos países   ficha...Indicadores compostos para medir o grau de desenvolvimento dos países   ficha...
Indicadores compostos para medir o grau de desenvolvimento dos países ficha...
 
İş Geli̇şti̇rme
İş Geli̇şti̇rmeİş Geli̇şti̇rme
İş Geli̇şti̇rme
 
Collection Health&Nutrition Catalogue - Romania 1/2017
Collection Health&Nutrition Catalogue - Romania 1/2017Collection Health&Nutrition Catalogue - Romania 1/2017
Collection Health&Nutrition Catalogue - Romania 1/2017
 
Informativo nº 1 5º básico b semana 06 al 10 de marzo
Informativo nº 1   5º básico b semana 06 al 10 de marzoInformativo nº 1   5º básico b semana 06 al 10 de marzo
Informativo nº 1 5º básico b semana 06 al 10 de marzo
 

Similar to CQRS and Eventing Sourcing

Customer Support in the Big Data Era
Customer Support in the Big Data EraCustomer Support in the Big Data Era
Customer Support in the Big Data Era
DataWorks Summit
 
Scalable E-Commerce Data Pipelines with Kafka: Real-Time Analytics, Batch, ML...
Scalable E-Commerce Data Pipelines with Kafka: Real-Time Analytics, Batch, ML...Scalable E-Commerce Data Pipelines with Kafka: Real-Time Analytics, Batch, ML...
Scalable E-Commerce Data Pipelines with Kafka: Real-Time Analytics, Batch, ML...
HostedbyConfluent
 
Chrysalis simplicity
Chrysalis simplicityChrysalis simplicity
Chrysalis simplicity
Ramco Systems
 
Blasting the analytics myths - what your users do vs. what you think they do,...
Blasting the analytics myths - what your users do vs. what you think they do,...Blasting the analytics myths - what your users do vs. what you think they do,...
Blasting the analytics myths - what your users do vs. what you think they do,...
Internet World
 
Understanding Business APIs through statistics
Understanding Business APIs through statisticsUnderstanding Business APIs through statistics
Understanding Business APIs through statistics
WSO2
 

Similar to CQRS and Eventing Sourcing (20)

Analytics and AI based Retention in e-commerce
Analytics and AI based Retention in e-commerceAnalytics and AI based Retention in e-commerce
Analytics and AI based Retention in e-commerce
 
John Rhodes - DevOps Automated Testing
John Rhodes - DevOps Automated TestingJohn Rhodes - DevOps Automated Testing
John Rhodes - DevOps Automated Testing
 
How Online Retailers Can Benefit from Enhanced Ecommerce?
How Online Retailers Can Benefit from Enhanced Ecommerce?How Online Retailers Can Benefit from Enhanced Ecommerce?
How Online Retailers Can Benefit from Enhanced Ecommerce?
 
Product analytics evolution: analytics approaches on different stages of the ...
Product analytics evolution: analytics approaches on different stages of the ...Product analytics evolution: analytics approaches on different stages of the ...
Product analytics evolution: analytics approaches on different stages of the ...
 
How to Run a Data Driven Product Dev Organization by Skedulo CPM
How to Run a Data Driven Product Dev Organization by Skedulo CPMHow to Run a Data Driven Product Dev Organization by Skedulo CPM
How to Run a Data Driven Product Dev Organization by Skedulo CPM
 
Product Increment Feedback Architecture - DevOpsDays - Warsaw
Product Increment Feedback Architecture - DevOpsDays - WarsawProduct Increment Feedback Architecture - DevOpsDays - Warsaw
Product Increment Feedback Architecture - DevOpsDays - Warsaw
 
Customer Support in the Big Data Era
Customer Support in the Big Data EraCustomer Support in the Big Data Era
Customer Support in the Big Data Era
 
Looker's Ben Porterfield - Asking The Right Questions
Looker's Ben Porterfield - Asking The Right QuestionsLooker's Ben Porterfield - Asking The Right Questions
Looker's Ben Porterfield - Asking The Right Questions
 
Measure your product performance
Measure your product performanceMeasure your product performance
Measure your product performance
 
Scalable E-Commerce Data Pipelines with Kafka: Real-Time Analytics, Batch, ML...
Scalable E-Commerce Data Pipelines with Kafka: Real-Time Analytics, Batch, ML...Scalable E-Commerce Data Pipelines with Kafka: Real-Time Analytics, Batch, ML...
Scalable E-Commerce Data Pipelines with Kafka: Real-Time Analytics, Batch, ML...
 
Data - How to Use it & When by Square and Call Rail Product Leader
Data - How to Use it & When by Square and Call Rail Product LeaderData - How to Use it & When by Square and Call Rail Product Leader
Data - How to Use it & When by Square and Call Rail Product Leader
 
Getting Actionable Insights with Google Analytics - Webinar
Getting Actionable Insights with Google Analytics - Webinar Getting Actionable Insights with Google Analytics - Webinar
Getting Actionable Insights with Google Analytics - Webinar
 
Chrysalis simplicity
Chrysalis simplicityChrysalis simplicity
Chrysalis simplicity
 
Blasting the analytics myths - what your users do vs. what you think they do,...
Blasting the analytics myths - what your users do vs. what you think they do,...Blasting the analytics myths - what your users do vs. what you think they do,...
Blasting the analytics myths - what your users do vs. what you think they do,...
 
Nordstrom Rack | Hautelook: Building a Customer-Centered Culture
Nordstrom Rack | Hautelook: Building a Customer-Centered CultureNordstrom Rack | Hautelook: Building a Customer-Centered Culture
Nordstrom Rack | Hautelook: Building a Customer-Centered Culture
 
GAUC 2020 - presentatie Hans en Reinier
GAUC 2020 - presentatie Hans en ReinierGAUC 2020 - presentatie Hans en Reinier
GAUC 2020 - presentatie Hans en Reinier
 
Final PPT
Final PPTFinal PPT
Final PPT
 
Understanding Business APIs through statistics
Understanding Business APIs through statisticsUnderstanding Business APIs through statistics
Understanding Business APIs through statistics
 
Test & Learn: How to Find Your Product's North Star Metric
Test & Learn: How to Find Your Product's North Star Metric Test & Learn: How to Find Your Product's North Star Metric
Test & Learn: How to Find Your Product's North Star Metric
 
BrightonSEO - Understanding Your Customers with Google Analytics
BrightonSEO - Understanding Your Customers with Google AnalyticsBrightonSEO - Understanding Your Customers with Google Analytics
BrightonSEO - Understanding Your Customers with Google Analytics
 

Recently uploaded

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Recently uploaded (20)

Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%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
 
%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
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 

CQRS and Eventing Sourcing

  • 2. Data Modelling - Third Normal Form
  • 3. Performance with 3NF ❖ Launching brand new product ❖ 000s hits per second Products Product Comments Product Reviews Product Inventory Best Sellers
  • 4. Losing data ❖ Who said it was okay to remove data? User Shopping Cart User Id Product Quantity 1 Tennis Racquet 1 1 Samsung Note 3 1 1 30” Monitor 2 DELETE FROM UserShoppingCart WHERE Product = ’30” Monitor’
  • 5. Audit / History Logs AccountId Balance When 1234 0 01 Jan 2015 1234 1000 05 Jan 2015 AccountId Balance 1234 $1000 Trigger / Event Based / Explicit Account Account History
  • 6.
  • 7. Event Sourced Shopping Cart Cart Created 3 Items Added 1 Item Removed Checked Out WRITE SIDE Task Based UI Projection READ SIDE
  • 8. Advantages of Event Sourcing ❖ Fantastic Performance ❖ Events are appended only - forward only. ❖ Allows our query model to be custom made for each Task Based UI ❖ Events are immutable ❖ Very easy to scale up ❖ Easier to test ❖ Reply events to replicate issues ❖ Smoke test - Rerun REAL production scenarios ❖ Business Value - allows you to analyse behaviour and events ❖ Not limited to “current state”
  • 11.
  • 12. Eventual Consistency ❖ Eventual Consistency sounds bad ❖ But in reality, most of us are dealing with it without realising. ❖ Part of distributed computing - CAP Theorem ❖ Consistency ❖ System Availability ❖ Network Partitioning ❖ Many ways to handle it
  • 13. Task Based UI ❖ a.k.a Inductive UIs ❖ Opposite to CRUD UI ❖ User Interface should be presented in terms of the problem domain ❖ Example ❖ User Interface should be presented for one task, in a clear fashion ❖ Works well with Domain Driven Design ❖ Helps in naming Commands / Requests (Queries)
  • 14. Event Driven Architecture ❖ This is a top level architecture pattern ❖ Domain events are published ❖ Anyone can subscribe to them ❖ Medium - Message Bus ❖ Execute a loosely coupled, cross system workflow

Editor's Notes

  1. Who models their database in 3NF? When 95% of our transactions on our system are read, why are we optimising for write? We learnt it was the way.. at uni. Space is valuable.
  2. Shopping cart performance problem. New product launch. High profile. Gets slammed. Inventory, Reviews, Comments, Top Seller, Sales counts
  3. There was some research done and found there is a correlation between items removed from a cart within x minutes of checkout and purchasing that product within the next 6 months. Now.. getting this data in 3NF would be almost impossible - So lets start capturing the data. And produce a report, but the report has no data - because we haven't capturing anything yet. Damn!
  4. How do people Log? Can anyone prove that their log is 100% correct and valid How do banks do it?
  5. This is how databases do it.
  6. Event Sourced Shopping Cart Business Behaviour A single model cannot be appropriate for reporting, searching and transactional behaviours.
  7. Talk about CQS / CQRS
  8. Requests and Commands named in Ubiquitous Language Query store can be one table per UI View (Task Based UI) Query store can be whatever suits the problem
  9. Is not a property of CQRS! More so integrating between two systems (Event Sourcing) SignalR
  10. Example: Change of Address Typo Moved address Additional address