16
votes
Rehydrating Aggregates from a "snapshots" projection rather than the Event Store
What I'm not super clear on is why you would ever rehydrate your Aggregates from the Event Store itself.
Because the "events" are the book of record.
If projecting changes to "read" databases is so ...
9
votes
Accepted
CQRS-Event Sourcing: how to process events in the expected order inside the read model
The infrastructure for the event sourcing is an event store which saves the events as documents inside a MongoDB collection and then publish a corresponding message to a service bus, so that with a ...
9
votes
DTO vs. read model
If I understand the concept of read models correctly, then it's just a simple query to return a use case specific data set.
That's not quite right.
DTO's are a boundary artifact
an object that ...
8
votes
Accepted
CQRS and microservices: passing information from one service to another
We're building two microservices that use CQRS and Event Sourcing: an Order Service and an Inventory Service. When an order is made, the inventory of that item must be decreased by the amount ordered. ...
7
votes
Accepted
Reducing the code duplication between read and write application in CQRS
It's pretty natural to have some duplication between the Command side and Query side, starting with knowing the same essential Events and payload structures. While standard structures might still be ...
6
votes
Accepted
How do event sourced systems make sure the read model is only updated once?
If the User Management Service is scaling, leading to multiple instances running at the same time, how can it be ensured that the logic doesn't add the same user twice?
There are a couple of different ...
6
votes
Rehydrating Aggregates from a "snapshots" projection rather than the Event Store
Since you don't specify what would the purpose of the "write" database would be, I will assume here that what you mean is this: when registering a new update to an aggregate, instead of rebuilding the ...
4
votes
Accepted
DDD - Same ID/Primary Key, different Aggragate Root class per Bounded Context
I recently answered a different question with a similar answer here:
Can aggregate root reference another another root?
I think you are actually approaching your problem perfectly.
I think mapping ...
3
votes
Rehydrating Aggregates from a "snapshots" projection rather than the Event Store
The main reason is performance. You could store a snapshot for every commit (commit = the events that are generated by a single command, usually only one event) but this is costly. Along the snapshot ...
3
votes
Accepted
CQRS, What reasons cause read model update delay? How to prevent user from taking inconsistence data?
I'm wonder how much read model delayed? What reason(s) cause it for delay? If I have only little preprocessing process data for read model. I have no experience at scale.
"It depends." The cause of ...
3
votes
Accepted
Does CQRS need to be fire and forget, If we need to read guarantee after command?
One way to view CQRS is that it's commands (messages) all the way down.
Taking your example:
Application layer send GiveReward command to reward management with a correlation ID.
Reward management ...
2
votes
Accepted
ES/CQRS: How to access additional information in projections
Option 1:
WorkOrderCreatedEvent including the warehouseName would make the construction of the event more complex as now you have to query for the WareHouse for construction the event. This complexity ...
1
vote
How to load consistent test data into multiple applications (which communicate by message streams)?
If your goal is to initialize the system with test data and not to test the REST functionality, then direct database access seems to be the easiest and best reproducible approach. You probably need to ...
1
vote
get aggregate id based on its data in it
But I think I am doing it wrong
You've got good instincts. There's a lack of clarity in the thinking around this scenario and everything will be easier if we can clean that up.
I have an aggregate ...
1
vote
Event Sourcing - Reconstituting Aggregate from Wrong Event Stream
What you are trying to prevent is strange because there is no difference between the events that are ignored intentionally and the wrong events.
One solution is to load the events based not only on ...
1
vote
Event Sourcing - Reconstituting Aggregate from Wrong Event Stream
Is there something else I'm not considering?
One thing you are not considering is a typesafe interface for your identifiers.
Customer customer = repo.Get<Customer>(productId);
Product product = ...
1
vote
Does CQRS need to be fire and forget, If we need to read guarantee after command?
Does CQRS need to be fire and forget, If we need to read guarantee after command?
CQRS doesn't need to be fire and forget. We typically acknowledge commands that cross process boundaries; it's a way ...
1
vote
Does CQRS need to be fire and forget, If we need to read guarantee after command?
No. This is a mix up of a few concepts. The single main point is that your underlying data model is not necessarily exposed in the same way for updates as read operations. There is nothing ...
1
vote
How do event sourced systems make sure the read model is only updated once?
Apache Kafka includes a feature for automatically managing consumer partition subscriptions, so that only a single consumer in a particular consumer group (such as the user read model updater consumer ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
read-model × 23cqrs × 20
event-sourcing × 14
domain-driven-design × 12
eventual-consistency × 4
microservices × 3
dto × 2
testing × 1
architectural-patterns × 1
domain-model × 1
validation × 1
distributed-system × 1
aggregate × 1
distributed-computing × 1
messaging × 1
event-handling × 1