Friday, February 21, 2014

CQRS Panaceum?

I have learnt today about CQRS (Command Query Responsibility Segregation). I must admit that it is a smart idea and really has some benefits - offloading reads is the one I like most.

However the bottleneck is in my opinion the impedance mismatch between the read model and the database especially when using an ORM.

The read model might be thinner than the write model hence there should be an adaptation from the mapped DTO's in write to the partial read model.

This is possible either in code by populating the read model - hence a duplication hell - because some of the fields have to be kept in sync. The other solution is to directly access the data store and get content - but this is very against the DDD/OO principles.

In conclusion every benefit comes with a cost...

No comments:

Post a Comment