I'm starting to introduce myself in CQRS concepts, but I get stucked with the following situation:Supouse you have an entity that must have an unique name.  In order to verify that, prior to create the entity you must make a query, thus you are verifing against the query subsystem.But what happens if the syncronization has not been happened between the command system and the query system yet?  Other client just had sent the same name before you.What happens in that case?
CQRS and validations
cqrs
Well, you should not use the query subsystem for validations - use the command subsystem for that. Look into the picture in Fowler's article here - validations are typically placed at the command model side. If, for example, you try to give an entity a unique name, your command subsystem should throw an exception if that name was already used before. The initiator of that command should expect that this may happen, even when he has used the query subsystem before to find a free name.That is, of course, for the case of eventual consistency between those different models, where there is a delay between the synchronisation. If you have a system where both models are strictly kept consistent, rules can be obviously different.