Skip to main content
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 ...
VoiceOfUnreason's user avatar
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 ...
VoiceOfUnreason's user avatar
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 ...
VoiceOfUnreason's user avatar
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. ...
VoiceOfUnreason's user avatar
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 ...
Subhash's user avatar
  • 1,681
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 ...
VoiceOfUnreason's user avatar
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 ...
Fyodor Soikin's user avatar
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 ...
Reasurria's user avatar
  • 156
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 ...
Constantin Galbenu's user avatar
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 ...
VoiceOfUnreason's user avatar
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 ...
Joeri Sebrechts's user avatar
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 ...
Nachiappan Kumarappan's user avatar
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 ...
Hans-Martin Mosner's user avatar
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 ...
Roger's user avatar
  • 287
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 ...
Constantin Galbenu's user avatar
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 = ...
VoiceOfUnreason's user avatar
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 ...
VoiceOfUnreason's user avatar
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 ...
LoztInSpace's user avatar
  • 1,348
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 ...
TomW's user avatar
  • 111

Only top scored, non community-wiki answers of a minimum length are eligible