- Does we apply CQRS to microservice architecture only?
- If we apply CQRS to microservice, then ProductCommand(to update command) & Product Query (to read command) will be different microservice?
Thanks in advance,
Venus
Thanks in advance,
Venus
Hi Venus,
You can just as well set up your ‘monolith’ with CQRS in mind, and start doing micro services once the need arises.
That is one of the neat things of CQRS. If you model your application correctly according to the standards, you don’t have to go micro-service first.
Hope this helps.
Cheers,
Steven
Thank you very much Steven for your answer.
i understood what you say, we can apply CQRS to monolith app to.
So to understand better, can you please consider situation where I have productService micro service which is performing CRUD operations.
Now I want to have Product Read and write Operation separate.
So I have to break my Product Service into 2 different micro service - Product Command Service, Product Read Service? Or we can manage Product Read Servive and Product Read Service under one microservice?
I am sorry it may be very basic question for you but I really need to know this to clear so many doubts running in my mind.
Regards
Hi Venus,
No worries about the basic questions, you’re free to ask them here!
Taking the example you give with a ‘ProductService’ which starts off as a monolith and you want to separate it, separating it into micro services along the read and write line definitely makes sense.
So yes, in that scenario the outcome could be a ‘ProductCommandService’ and a ‘ProductQueryService’.
That’s my two cents, hope it helps you out
Cheers,
Steven