9. Query Query Quite “Contrery” Showing data Query-only storage KISS, YAGNI If it’s stale anyway List of Customers --------------------- --------------------- --------------------- (from 10 minutes ago)
10. All Your Database Are Belong To Us Screen-based views UnDRY your data—data duplication “Persistent View Model” Storage/database requirements Scaling out SELECT * FROM Carts WHERE ID = 456;
11. Queries: Summary Stale data “Persistent View Model” For queries only One table per view Updated by events Data duplication is good No table relationships No foreign keys
12. Command & Conquer Say what? What is a command? Intention revealing SaveInvoicevsPlaceOrder SaveCustomervsMakeCustomerDelinquent
14. This Time It’s Gonna Be Different Can we fully trust user decisions?
15. Commands and Validation Validation Is the input potentially good? Ranges, lengths, etc Fail fast Leverage persistent view model Unique emails? Decides if a command should be sent Enables high probability of success
17. Commands: Summary Expresses intent Reply is: “Thank you, we’ve received your input.” Asynchronous Amazon Netflix
18. Domain Models, Take 2 Commands already validated No relationships for reading Only persists what it needs Behavior: Give discounts to high-volume customers