DEV Community

Discussion on: CQRS In Microservices – Breaking the Rules

 
wyulliam profile image
William Silva

I think in this case you should give up on consistency for the sake of availability. Of course this does not work in every system, but maybe this system does not need to know the exact updated address of the user (it is not a service trying to send you a letter, it just want to see your general profile to sell you a car).
In those system, the cache data could be invalidated after que Command event was done.
But again, it all depends on what system are we working with

Thread Thread
 
jeastham1993 profile image
James Eastham

Yeah, that's a great point.

I have two separate implementations at the moment that fit both models. One is a postcode lookup service, so the address that is found absolutely needs to be returned without fail (highly available).

Another implementation has a dataset that is used in numerous different places, but can be up to 15-30 minutes old without causing any issues (eventual consistency, looser coupling).