New answers tagged cqrs
You could use an index. This is generally not something that you will find in an eventstore, so you will most likely need to use an external indexing engine for this. This index would then have to be updated everytime that someone changes a carts contents, and this index update would most likely be async. This would mean that you cannot rely on your index ...
Conceptually wrong? I'd say: "Yes!" Looks like you're willing to do CRUD. Nothing intrinsically wrong with that. But it's conceptually not CQRS. If you just need CRUD to solve your problem, just use CRUD.
No, the read model is for reading, the write model for writing If you have a system that requires you to use CQRS (and it is something that you really should think long and hard about), you cannot use the write model to get the most recent data in the UI. You design your application in such a way that it can handle the delay between the write operation and ...
I would say that the command interface isn't supposed support queries, and the write model should not necessarily be exposed to client applications for that purpose. However, the notion you're looking for in the first question: is it conceptually wrong to query write model in order to get the most recent state of an entity for the page? seems to be ...
Read model will not be affected by optimistic concurrency because it is read-only and will get returned to you in whichever state it is at the moment of request. The only thing you have to worry about is making changes to the same write model simultaneously.
Top 50 recent answers are included