Your SlideShare is downloading. ×
0
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Cqrs race conditions_and_sagas_ohmy

5,289

Published on

Published in: Technology, News & Politics
0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
5,289
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
68
Comments
0
Likes
6
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • This is a fact of life – like gravity – you can’t fight it.
  • We see this on Twitter and Facebook – telling us how long ago something happened
  • Don’t need all data in the DB or in the rules – what needs to be in there?
  • If a use clicked a button a microsecond earlier or later, that shouldn’t change fundamental business objectives.
  • Race conditions will cause many commands to fail, undoing much of the foundation of CQRS
  • Which indicates that there’s a bug in the requirements
  • Transcript

    • 1. CQRS Races Sagas Domain Model
    • 2. Get dataGet data Change dataUser is looking at stale data
    • 3. Data correct as of 10 minutes ago List of customers
    • 4. List of customers Customer Service Rep view ID Name Phone List of customers Supervisor view ID Name Phone Lifetime value
    • 5. Queries Commands DB Service Layer Input Validation Validation Rules Queries View Model View Model Updater Publish Client
    • 6. Cancel OrderShip Order Rules: 1. Cannot cancel shipped orders 2. Don’t ship cancelled orders
    • 7. public class Order { public void Cancel() { if (status != OrderStatusEnum.Shipped) //cancel } public void Ship() { if (status != OrderStatusEnum.Cancelled) //ship } }
    • 8. Looks like we’re stuck
    • 9. The customer doesn’t want the products No point in arguing
    • 10. Rules: 1. Cannot cancel shipped orders Because shipping costs money That money would be lost if the customer cancelled Because we refund the customers money 2. Don’t ship cancelled orders
    • 11. www.NServiceBus.com
    • 12. Queries Commands DB Service Layer Input Validation Validation Rules Queries View Model View Model Updater Publish Client
    • 13. CQRS Races Sagas Domain Model

    ×