Questions tagged [cqrs]
Command Query Responsibility Segregation design pattern
308 questions
2votes
1answer
72views
how to update the state of many aggregates in event sourcing at once
I have one service that I plan to write using the concept of event sourcing and CQRS. The bottom line is that it has an aggregate, let's say a Person. Person{ ID Name // name of person Surname // ...
4votes
4answers
257views
how can CQRS improve performence when we have to duplicate the writes
I was reading about CQRS, and from what I understand, it separates reading from writing by using two databases: one for queries (reading) and another for commands (writing). However, I don’t quite get ...
1vote
3answers
177views
How to handle authorization in CQRS
In a CQRS architecture, at least as implemented by Vaughn Vernon in IDDD_Samples, the query services lives in the application layer. But then where and how should authorization be handled? For example,...
0votes
1answer
163views
storing aggregates as json in postgresql all in one table
I am trying to decide what the best way of storing my data would be. I want to build a cqrs application where I also apply DDD principles like aggregates in the command side. I started with with ...
1vote
3answers
226views
Can an aggregate just depend on the ID of another aggregate for its own identity?
I started writing my application with a very understandable assumption that every Aggregate should be represented by a root entity that has its own ID (a surrogate key). But I think I have found a ...
2votes
4answers
172views
Where are random numbers generated in Clean/CQRS architected application
Assume I have a value object in my application with random numbers for underlying values. These value objects will serve as attributes to my entity (aggregate root). In my specific case (just for ...
2votes
3answers
863views
Should we call a command inside another command in CQRS?
I know there are many posts on this question but none of them gives a clear answer or solution (atleast for my specific case) Some of them are In CQRS/ES, can a command create another command? https://...
-2votes
2answers
201views
When should I think about two databases (the first for reads, the second for writes) in CQRS?
I am not asking what are advantages of two databases - the first for reads and the second for writes. I am asking WHEN I should have two databases for reads and writes? Probably there is no simple ...
1vote
2answers
255views
CQRS: Multiple entry points for a single command
I’m trying to follow the Clean Architecture and CQRS within an application that, let’s say, create a product. To achieve this, the application has 3 adapters, one for reading a file, another for ...
0votes
2answers
177views
cqrs/ddd - What is the point of having informational Data in the write model/aggregate?
I am wondering whether it makes sense to not store informational Data inside the write model database. By informational Data I mean data that is not directly used for any decision making in the write ...
0votes
0answers
278views
DDD - How do scheduled tasks fit in CQRS/DDD
I am trying out CQRS, Event Sourcing and DDD in a project and I want to model a Reminder Service. The context is as follows: Person A creates a Task for Person B and sets a Deadline for Person B to ...
1vote
2answers
112views
CQRS how to display failed commands in the GUI
I am trying to use CQRS in my project and I was thinking how the GUI gets notified about failures in the GUI, when commands are fire and forget. My commandhandlers are not returning anything, but ...
0votes
1answer
83views
Contextual Data on CQRS Requests
I use CQRS for most of my applications. My request objects contain the data needed by the Handler to perform the Request. However, I've started to realize that some data points we have are required on ...
1vote
2answers
1kviews
In DDD, how can repositories be optional?
I was reading the infrastructure persistence layer design documentation, and this quote has me confused: This'll probably be my biggest feedback. I'm really not a fan of repositories, mainly because ...
2votes
1answer
931views
How to handle aggregations of out-of-order events in an event stream?
I'm interested in integrating with an external system which uses webhooks to notify clients of events. The system is very similar to Stripe - the REST endpoints have rate limits to avoid undue polling ...