SlideShare a Scribd company logo
1 of 25
ISKA 08/2010 CQRS & QueueUnlimited
Introductionto CQRS pattern QueueUnlimited concepts andimplementation Demo What we are goingtosee
“Crack” for architects CQRS
Command Query Responsibility Segregation CQRS
CQRS – Why do we needit? FE Shop FE Administration BS Customer BS CRM
CQRS – Why do we needit? FE Shop FE Administration View Model Controller BS Customer BS CRM Service Layer DTO’s Services Domain (business logic) Data Access Layer
CQRS – Why do we needit? HTML View Model View Model Controller Service Layer SOAP / REST schema’s DTO’s Services Domain (business logic) Rows OO objects Data Access Layer
“How long wouldit take tocreate a screen likethis?” CQRS – WHY DO WE NEED IT?
In a traditional 3 layered SOA: Small changes = relative big impact Performance problems are very hard tosolve Mapping, mappingmapping Serialization, Serialization, … Authorizationhell Alllayers are coupled ,[object Object],CQRS – WHY DO WE NEED IT?
<asp:DataList ID="DataList1" runat="server" DataSourceID="LastUsersDataSource">     <ItemTemplate>         <asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name") %>' />         <br />     </ItemTemplate> </asp:DataList> <asp:SqlDataSource ID="LastUsersDataSource" runat="server" ConnectionString="<%$ ConnectionStringsMyConnectionString%>" SelectCommand="SELECT [Name], [InsertDateTime] FROM [LastUsers] ORDER BY [InsertDateTime] DESC"> </asp:SqlDataSource> MS demo’s rule !
Let’ssegregatequeriesandcommands Query: Query without transforming or mapping Show stale data whenever we can 2 Tier Data store foreachview (persisted views) Command: Talk in business events Keep all events as a truth Tell, don’task Asyncwhenever we can 3 Tier CQRS - to the rescue
CQRS - to the rescue UI UI DataStore Queries Subscribe EventBus Commands Business Logic Publish Truth (optional)
CQRS - to the rescue FE Shop FE Administration BS Customer BS CRM Events
Audit tracing Asyncby design Scalableby design Compensationable logic / conversations Close to the business Feature’s share no data/code = rapiddevelopment Best storage for best needs (ex: RDBMS forcommand processing, document basedfor UI datastore) Replayable Performance cannot get killedafteraddingthatone cool feature Rollout! Easy to unit test: Given <Previous Events> When <Command> is fired Then  <New Events> expected CQRS - Advantages
Requiresalsoother view on specificationandtesting  canbeconsideredan advantage  Release management has tobe different (per feature style)   disadantagebecause of oldstyle program managers  Very hard toimplementcorrectly Needsmuch disc space  Eventuallyconsistencyseemsscarryto most IT managers CQRS - DISADvantages
QueueUnlimited
OpenSource project startedby Marc Rexwinkel en Tim Mahy http://queueunlimited.codeplex.com/ For current customer platform: Sql Server 2008 R2 Sql Server Service Broker .NET 3.5 Queue Unlimited
A queue like data store that allows asynchronous processing A data store that can distribute it’s messages to multiple subscribers A data store that can perform a replay of it’s messages (from a certain period or all messages) A data store that can check retention lifetime of messages and remove them when necessary A data store that can optionally send all previous messages to a subscriber that is added a long time after an message was fired A data store that is manageable through default tooling (performance monitoring, intervening when production problems occur, backup …) A data store that can scale up or scale out A data store that can preserve the ordering of messages inside groups (functional partitioning) A data store that is fully ACID without a two phase commit (so no DTC) Queue Unlimited
UsesonlyStored Procedures Implementedusing SSB Queue Unlimited
How itworks Queue Unlimited – no subscribers PublishEvent SP InitiatorService Root Queue RootService
Queue Unlimited – Adding a subscriber PublishEvent SP InitiatorService Root Queue RootService Activated RootQueueActivation SP Replay 1 InitiatorService SubscriberInitiatorService Subscriber 1 Queue Replay 1 Queue Replay 1 ReceiveService SubscriberReceiveService Notactivated Generated  SP Someapp
QUEUE UNLIMITED – Addinganothersubscriber SendEvent SP Initiator service Root Queue Receive Service Activated Distribute SP Initiator service 3 Initiator service 2 Subscriber 1 Queue Replay 1 Queue Receive Service 3 Receive Service 2 Activated Someapp Distribute 3 SP Initiator service 5 Initiator service 4 Subscriber 2 Queue Replay 2 Queue Receive Service 4 Receive Service 5 Notactivated Someapp Distribute 4 SP
QUEUE UNLIMITED – Garbagecollection SendEvent SP Initiator service Root Queue Receive Service Activated Distribute SP Initiator service 5 Initiator service 2 Initiator service 4 Subscriber 1 Queue Replay 2 Queue Subscriber 2 Queue Receive Service 5 Receive Service 2 Receive Service 4 Notactivated Distribute 4 SP Someapp Someapp
Open forsomefreshdevelopers     Queue Unlimited
MultiplayerDice website Part of QueueUnlimitedforshowing demo possibilities For more demo’s look at: NCQRS (http://ncqrs.org/) CQRS4J (http://code.google.com/p/cqrs4j/) For more detailed information look at: http://skillsmatter.com/podcast/open-source-dot-net/udi-dahan-command-query-responsibility-segregation http://www.infoq.com/interviews/dahan-cqrs-ddd-nservicebus DEMO

More Related Content

Similar to CQRS & Queue unlimited

Service Lifecycle Management with Fuse Service Works
Service Lifecycle Management with Fuse Service WorksService Lifecycle Management with Fuse Service Works
Service Lifecycle Management with Fuse Service Works
Kenneth Peeples
 
Senior Systems Engineering ( Microsoft) .
Senior Systems Engineering ( Microsoft) .Senior Systems Engineering ( Microsoft) .
Senior Systems Engineering ( Microsoft) .
chalikars
 
Data Con LA 2019 - MetaConfig driven FeatureStore with Feature compute & Serv...
Data Con LA 2019 - MetaConfig driven FeatureStore with Feature compute & Serv...Data Con LA 2019 - MetaConfig driven FeatureStore with Feature compute & Serv...
Data Con LA 2019 - MetaConfig driven FeatureStore with Feature compute & Serv...
Data Con LA
 

Similar to CQRS & Queue unlimited (20)

Camunda BPM 7.2: Performance and Scalability (English)
Camunda BPM 7.2: Performance and Scalability (English)Camunda BPM 7.2: Performance and Scalability (English)
Camunda BPM 7.2: Performance and Scalability (English)
 
Service Lifecycle Management with Fuse Service Works
Service Lifecycle Management with Fuse Service WorksService Lifecycle Management with Fuse Service Works
Service Lifecycle Management with Fuse Service Works
 
WebSphere Technical University: Top WebSphere Problem Determination Features
WebSphere Technical University: Top WebSphere Problem Determination FeaturesWebSphere Technical University: Top WebSphere Problem Determination Features
WebSphere Technical University: Top WebSphere Problem Determination Features
 
System Architecture Exploration Training Class
System Architecture Exploration Training ClassSystem Architecture Exploration Training Class
System Architecture Exploration Training Class
 
5 Years Of Building SaaS On AWS
5 Years Of Building SaaS On AWS5 Years Of Building SaaS On AWS
5 Years Of Building SaaS On AWS
 
Building an Observability Platform in 389 Difficult Steps
Building an Observability Platform in 389 Difficult StepsBuilding an Observability Platform in 389 Difficult Steps
Building an Observability Platform in 389 Difficult Steps
 
Migrating on premises workload to azure sql database
Migrating on premises workload to azure sql databaseMigrating on premises workload to azure sql database
Migrating on premises workload to azure sql database
 
AWS re:Invent 2016: Life Without SSH: Immutable Infrastructure in Production ...
AWS re:Invent 2016: Life Without SSH: Immutable Infrastructure in Production ...AWS re:Invent 2016: Life Without SSH: Immutable Infrastructure in Production ...
AWS re:Invent 2016: Life Without SSH: Immutable Infrastructure in Production ...
 
Lets focus on business value
Lets focus on business valueLets focus on business value
Lets focus on business value
 
Operational Visibiliy and Analytics - BU Seminar
Operational Visibiliy and Analytics - BU SeminarOperational Visibiliy and Analytics - BU Seminar
Operational Visibiliy and Analytics - BU Seminar
 
C19013010 the tutorial to build shared ai services session 2
C19013010 the tutorial to build shared ai services session 2C19013010 the tutorial to build shared ai services session 2
C19013010 the tutorial to build shared ai services session 2
 
Apache Kafka - Scalable Message-Processing and more !
Apache Kafka - Scalable Message-Processing and more !Apache Kafka - Scalable Message-Processing and more !
Apache Kafka - Scalable Message-Processing and more !
 
MetaConfig driven FeatureStore : MakeMyTrip | Presented at Data Con LA 2019 b...
MetaConfig driven FeatureStore : MakeMyTrip | Presented at Data Con LA 2019 b...MetaConfig driven FeatureStore : MakeMyTrip | Presented at Data Con LA 2019 b...
MetaConfig driven FeatureStore : MakeMyTrip | Presented at Data Con LA 2019 b...
 
Microservices and Prometheus (Microservices NYC 2016)
Microservices and Prometheus (Microservices NYC 2016)Microservices and Prometheus (Microservices NYC 2016)
Microservices and Prometheus (Microservices NYC 2016)
 
Senior Systems Engineering ( Microsoft) .
Senior Systems Engineering ( Microsoft) .Senior Systems Engineering ( Microsoft) .
Senior Systems Engineering ( Microsoft) .
 
Real-World Pulsar Architectural Patterns
Real-World Pulsar Architectural PatternsReal-World Pulsar Architectural Patterns
Real-World Pulsar Architectural Patterns
 
Data Con LA 2019 - MetaConfig driven FeatureStore with Feature compute & Serv...
Data Con LA 2019 - MetaConfig driven FeatureStore with Feature compute & Serv...Data Con LA 2019 - MetaConfig driven FeatureStore with Feature compute & Serv...
Data Con LA 2019 - MetaConfig driven FeatureStore with Feature compute & Serv...
 
Os Solomon
Os SolomonOs Solomon
Os Solomon
 
Super Sizing Youtube with Python
Super Sizing Youtube with PythonSuper Sizing Youtube with Python
Super Sizing Youtube with Python
 
An Introduction to Microservices
An Introduction to MicroservicesAn Introduction to Microservices
An Introduction to Microservices
 

More from Tim Mahy (8)

2013 training - tim m - cross cutting concerns
2013   training - tim m - cross cutting concerns2013   training - tim m - cross cutting concerns
2013 training - tim m - cross cutting concerns
 
2009 seminar - tim m - vs 2010 developer edition
2009   seminar - tim m - vs 2010 developer edition2009   seminar - tim m - vs 2010 developer edition
2009 seminar - tim m - vs 2010 developer edition
 
2009 training - tim m - object oriented programming
2009   training - tim m - object oriented programming2009   training - tim m - object oriented programming
2009 training - tim m - object oriented programming
 
2010 iska - tim m - functioneel programmeren in c-sharp
2010   iska - tim m - functioneel programmeren in c-sharp2010   iska - tim m - functioneel programmeren in c-sharp
2010 iska - tim m - functioneel programmeren in c-sharp
 
2010 iska - tim m - nosql iska
2010   iska - tim m - nosql iska2010   iska - tim m - nosql iska
2010 iska - tim m - nosql iska
 
2011 iska - tim m - domain driven design
2011   iska - tim m - domain driven design2011   iska - tim m - domain driven design
2011 iska - tim m - domain driven design
 
2012 student track - vs2010
2012   student track - vs20102012   student track - vs2010
2012 student track - vs2010
 
communityday 2012 - cqrs
communityday 2012 - cqrscommunityday 2012 - cqrs
communityday 2012 - cqrs
 

CQRS & Queue unlimited

  • 1. ISKA 08/2010 CQRS & QueueUnlimited
  • 2. Introductionto CQRS pattern QueueUnlimited concepts andimplementation Demo What we are goingtosee
  • 4. Command Query Responsibility Segregation CQRS
  • 5. CQRS – Why do we needit? FE Shop FE Administration BS Customer BS CRM
  • 6. CQRS – Why do we needit? FE Shop FE Administration View Model Controller BS Customer BS CRM Service Layer DTO’s Services Domain (business logic) Data Access Layer
  • 7. CQRS – Why do we needit? HTML View Model View Model Controller Service Layer SOAP / REST schema’s DTO’s Services Domain (business logic) Rows OO objects Data Access Layer
  • 8. “How long wouldit take tocreate a screen likethis?” CQRS – WHY DO WE NEED IT?
  • 9.
  • 10. <asp:DataList ID="DataList1" runat="server" DataSourceID="LastUsersDataSource"> <ItemTemplate> <asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name") %>' /> <br /> </ItemTemplate> </asp:DataList> <asp:SqlDataSource ID="LastUsersDataSource" runat="server" ConnectionString="<%$ ConnectionStringsMyConnectionString%>" SelectCommand="SELECT [Name], [InsertDateTime] FROM [LastUsers] ORDER BY [InsertDateTime] DESC"> </asp:SqlDataSource> MS demo’s rule !
  • 11. Let’ssegregatequeriesandcommands Query: Query without transforming or mapping Show stale data whenever we can 2 Tier Data store foreachview (persisted views) Command: Talk in business events Keep all events as a truth Tell, don’task Asyncwhenever we can 3 Tier CQRS - to the rescue
  • 12. CQRS - to the rescue UI UI DataStore Queries Subscribe EventBus Commands Business Logic Publish Truth (optional)
  • 13. CQRS - to the rescue FE Shop FE Administration BS Customer BS CRM Events
  • 14. Audit tracing Asyncby design Scalableby design Compensationable logic / conversations Close to the business Feature’s share no data/code = rapiddevelopment Best storage for best needs (ex: RDBMS forcommand processing, document basedfor UI datastore) Replayable Performance cannot get killedafteraddingthatone cool feature Rollout! Easy to unit test: Given <Previous Events> When <Command> is fired Then <New Events> expected CQRS - Advantages
  • 15. Requiresalsoother view on specificationandtesting  canbeconsideredan advantage  Release management has tobe different (per feature style)  disadantagebecause of oldstyle program managers  Very hard toimplementcorrectly Needsmuch disc space  Eventuallyconsistencyseemsscarryto most IT managers CQRS - DISADvantages
  • 17. OpenSource project startedby Marc Rexwinkel en Tim Mahy http://queueunlimited.codeplex.com/ For current customer platform: Sql Server 2008 R2 Sql Server Service Broker .NET 3.5 Queue Unlimited
  • 18. A queue like data store that allows asynchronous processing A data store that can distribute it’s messages to multiple subscribers A data store that can perform a replay of it’s messages (from a certain period or all messages) A data store that can check retention lifetime of messages and remove them when necessary A data store that can optionally send all previous messages to a subscriber that is added a long time after an message was fired A data store that is manageable through default tooling (performance monitoring, intervening when production problems occur, backup …) A data store that can scale up or scale out A data store that can preserve the ordering of messages inside groups (functional partitioning) A data store that is fully ACID without a two phase commit (so no DTC) Queue Unlimited
  • 20. How itworks Queue Unlimited – no subscribers PublishEvent SP InitiatorService Root Queue RootService
  • 21. Queue Unlimited – Adding a subscriber PublishEvent SP InitiatorService Root Queue RootService Activated RootQueueActivation SP Replay 1 InitiatorService SubscriberInitiatorService Subscriber 1 Queue Replay 1 Queue Replay 1 ReceiveService SubscriberReceiveService Notactivated Generated SP Someapp
  • 22. QUEUE UNLIMITED – Addinganothersubscriber SendEvent SP Initiator service Root Queue Receive Service Activated Distribute SP Initiator service 3 Initiator service 2 Subscriber 1 Queue Replay 1 Queue Receive Service 3 Receive Service 2 Activated Someapp Distribute 3 SP Initiator service 5 Initiator service 4 Subscriber 2 Queue Replay 2 Queue Receive Service 4 Receive Service 5 Notactivated Someapp Distribute 4 SP
  • 23. QUEUE UNLIMITED – Garbagecollection SendEvent SP Initiator service Root Queue Receive Service Activated Distribute SP Initiator service 5 Initiator service 2 Initiator service 4 Subscriber 1 Queue Replay 2 Queue Subscriber 2 Queue Receive Service 5 Receive Service 2 Receive Service 4 Notactivated Distribute 4 SP Someapp Someapp
  • 24. Open forsomefreshdevelopers     Queue Unlimited
  • 25. MultiplayerDice website Part of QueueUnlimitedforshowing demo possibilities For more demo’s look at: NCQRS (http://ncqrs.org/) CQRS4J (http://code.google.com/p/cqrs4j/) For more detailed information look at: http://skillsmatter.com/podcast/open-source-dot-net/udi-dahan-command-query-responsibility-segregation http://www.infoq.com/interviews/dahan-cqrs-ddd-nservicebus DEMO