domain driven design - How can CQRS contribute to more scalable applications -
lately i've been reading lot on cqrs architecture. 1 of foremost points stated on why 1 should use cqrs scalability.
now don't quite understand how can work.
let's have typical
cqrs application design.
- two datastores
- one command side
- one query side
- when command has been processed event send update second datastore
it's stated having datastore querying , 1 handling commands make application more scalable. how can work if second datastore stores event data needs respond query requests , needs update iteself based on incoming events ?
why not have 1 datastore commands stored , query side can re-use stored data fetching it's result data ?
you might find interesting read old blog post greg young himself, explains cqrs is.
cqrs not having 2 different stores, but, stated on greg's article:
cqrs creation of 2 objects there one. separation occurs based upon whether methods command or query
what describe here more event sourcing.
now question: how can cqrs contribute more scalable applications?
greg answers well:
cqrs allows host 2 services differently eg: can host read service on 25 servers , write service on two. processing of commands , queries fundamentally asymmetrical, , scaling services symmetrically not make lot of sense.
that's it!
Comments
Post a Comment