500 likes | 795 Views
Distributed Architecture Patterns CQRS & Event Sourcing. Application Lifecycle Expert. Dylan Smith Senior ALM Consultant.
E N D
Distributed Architecture Patterns CQRS & Event Sourcing
Application Lifecycle Expert Dylan Smith Senior ALM Consultant PROFILEDylan is an ALM (Application Lifecycle Management) consultant for Imaginet where he spends his time helping teams become more successful at delivering software. Dylan has over a decade experience designing and architecting mission critical applications. In the past 5 years Dylan has focused on agile development techniques and practices. He has led the shift to agile and lean development practices across multiple teams, projects and companies. “CQRS+ES differs from most design patterns in that it provides clear business benefits in addition to the obvious technical benefits.”
Overview • Review Typical Architecture • What is CQRS? • What is Event Sourcing? • CODE !!! • Benefits / Concerns
Data Storage Repository Typical Distributed Architecture Domain Object Domain Object Application Services Remote Facade Send DTO Status Returned Request DTO DTO Returned Client
Data Storage Data Storage CQRS Repository Domain Object Domain Object Command Handlers Query Handlers Remote Facade Remote Facade Send Command Ack/Nak Response Request DTO DTO Returned Client
Line Items (n) Purchase Order Shipping Information
Order Created Added 2 Shirts Added 4 Hats Shipping Info Added
Event Store Data Storage Event Bus Event Handlers CQRS + ES Repository Domain Object Domain Object Command Handlers Query Handlers Remote Facade Remote Facade Send Command Ack/Nak Response Request DTO DTO Returned Client
Domain Read Model Events DTOs Commands Client
Other Topics(Time Permitting) • Event Versioning • When to use CQRS/ES? • Using CQRS or ES separately • Concurrency • Eventual Consistency • Asynchronous Commands
Sample Code • Super Simple CQRS Example • github.com/gregoryyoung/m-r • NCQRS • ncqrs.org • The CQRS Kitchen • thecqrskitchen.codeplex.com • Lokad-CQRS • code.google.com/p/lokad-cqrs • Fohjin • github.com/MarkNijhof/Fohjin