Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [cqrs]

Command Query Responsibility Segregation design pattern

0
votes
1answer
66 views

Passing Keys instead of Messages

Recently I stood up a Redis server and tested the idea of storing application 'states' that only existed in our application and were never stored in our database. Don't know if we will ultimately do ...
0
votes
1answer
34 views

Circuit Breaker + Retry - Repository or Application Layer

I currently have a Web App using ASP.NET Core 2.2, Domain Driven Design, Clean Architecture, and CQRS. I'm using MongoDB as persistence. I have developed a Repository pattern to abstract the MongoDB ...
0
votes
2answers
63 views

DDD - Modifying multiple entities under multiple aggregate roots

In our domain we have a concept of billable activities that get logged by a user. The modeling is pretty straightforward -- the User is an aggregate root, with the Activities being a collection under ...
0
votes
1answer
106 views

CQRS with an Event Log and without Event Sourcing

I am trying to understand the difference between an event log and event store in the context of event sourcing. A really nice explanation I found is that an event store is the single source of truth ...
1
vote
1answer
37 views

is Event sourcing using Database CDC considered good architecture?

When we talk about sourcing events , we have have a simple dual write architecture where we can write to database and we can write the events to a queue like Kafka . Other downstream system can read ...
3
votes
1answer
57 views

DDD - Aggregate that changes “owner” mid-process

We're evaluating CQRS/ES for a high-volume subsystem in our app in order to take advantage of distributed systems and ensure uptime. This is my team's first time implementing this architecture, and I'...
0
votes
1answer
102 views

What is the full value of the CQS principle in a system that doesn't implement the CQRS pattern?

I'm having trouble grasping the value proposition of the "command" half of the CQS principle in a system that doesn't implement command query responsibility segregation. The CQS principle states that ...
1
vote
3answers
84 views

Domain Events, CQRS, and dependency resolution in handlers

Currently: ASP.NET Core 2.2. I've been doing quite an extensive research in this topic (Domain Driven Design used together with Clean Architecture): DDD: Where to place domain event handlers? And I'...
0
votes
1answer
127 views

Can the write database have different fields to the read database?

I am trying to learn CQRS in my spare time. Say I have a class like this: public class Person { private Guid Id {get; set;} private Guid Name {get; set;} private List<Order> orders; //...
0
votes
2answers
96 views

Anemic Domain Model, CQRS, command bus

Considering this pattern is used to support CQRS message bus, examples are buslane Python or MessageBus PHP It uses commands to change the domain model, and publishes domain events This looks great ...
2
votes
1answer
118 views

How to better scale reads in a website: to CQRS or not to CQRS?

The company i'm working for it's rewriting a legacy web application and we are evaluating the better architecture to get the job done. The business domain is quite simple: there are few entities, ...
0
votes
2answers
248 views

CQRS using queries or read services only?

Discussing about a CQRS implementation with my team we don’t agree on a point concerning the Query side. On the Commad side we have actual command clases; a CommandDispatcher that schedules commands, ...
1
vote
2answers
220 views

Should CQRS Command perform a Query?

I have Customer, Order, and Product Aggregate Roots... When the order is created, it takes in a Customer and a List<Sales.Items>. It looks something like: public class Order { public static ...
1
vote
2answers
479 views

Clean architecture, CQRS, and authentication?

I'm working on implementing my first clean architecture and CQRS application, I've stumbled across a bit of logic that's leaving me a bit stumped. I'm working on integrating authorization and ...
0
votes
1answer
32 views

CQRS across bounded contexts to generate reports with possible business logic

Where do you draw the line for how much logic can go in your read models? For example, we have 2 BCs: Inventory and Sales. We need to generate reports regarding inventory levels on specific dates: ...
1
vote
3answers
131 views

How to validate command before executing on aggregate when validation needs to query data?

In a DDD designed application with CQRS principle how do we handle the case when a command needs to be validated before it is executed on an aggregate and the validation needs to query the existing ...
0
votes
0answers
36 views

Choice between PUT and a separate request for each change for CRUD-based UI

I'm making an HTTP API for ASP.NET Core Identity. Basically what I want is a remote version of this: https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.identity.usermanager-1?view=...
2
votes
1answer
65 views

Should I store an event stream or just state for a frequently changing entity?

I am building a CQRS-based application with Kafka Streams. For most entities in my application this entails event sourcing: capturing state mutations as events and transforming them into state which ...
2
votes
1answer
227 views

How to model domain events so that the denormalizers can fill highly denormalized read models

I have been working with a software strongly relying on the event sourcing and CQRS patterns for a few time and I'm trying to figure out how to properly model the domain events in relation to the ...
2
votes
2answers
81 views

Denormalising a CRUD and ES bounded context for rich queries

As a small snapshot of my product, I have 2 bounded contexts, one which is a rich domain with defined events and invariants, operating on files implemented as CQRS/ES, and the other a CRUD store of ...
0
votes
1answer
54 views

Domain events or services to achieve domain model consistency?

Recently began implementing domain events in my domain layer which really allows me to decouple the application from the domain. Eventually, I would like to get a full-scale CQRS w/Event Sourcing ...
1
vote
2answers
108 views

get aggregate id based on its data in it

I have an aggregate root called SizeRangeAggregate which holds the range of size of clothing piece dimension and price for that range. I created an post rest API which create new SizeRangeAggregate. ...
0
votes
0answers
12 views

Is there any value in passivation (setReceiveTimeout) for persistent actors without read store?

I am not experienced in Akka, so my assumptions may be completely wrong. As far as I understand, Aggregate Root may manage its entities either just keeping their state internally and restoring it at ...
0
votes
2answers
344 views

In what layer are the DTOs stored with CQRS?

The Domain has the Domain Models. The Infrastructure layer has Commands and Queries, forming CQRS. Commands return Domain Models, and Queries return DTOs. In any API, the DTOs are stored in the ...
1
vote
2answers
421 views

Putting it all together - DDD, CQRS, Web API

I need some expert guidance. I'm trying to learn the concepts as well as implement them, and it's possible I might be over-engineering some. But that's OK, because I am wanting to learn and gain ...
2
votes
0answers
62 views

UI syncing in case of bulk operation api

In a CQRS system, the convention that we follow is we render the detail view of an aggregate(i.e getById) using the write model and views containing multiple aggregates(like a dashboard) using read ...
3
votes
4answers
460 views

Command handling fail feedback with CQRS

We are developing some context using CQRS approach. We have ended up with command handlers emitting events. It seems to be not a good idea to us. However we can't find any alternative approach. We ...
2
votes
2answers
113 views

Event Sourcing CQRS and request events ending at Requested

In ES/CQRS, do/can we treat requests as events? Consider the following flow A guest visited some url and posted data to create a new account. Here is one way to implement it 1- Invoke ...
0
votes
1answer
441 views

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. But a DTO seems to have the same purpose, but in a more complex way (...
1
vote
3answers
143 views

Event Sourcing - Reconstituting Aggregate from Wrong Event Stream

I am working on a project to help learn DDD and am trying to do CQRS and Event Sourcing. Code is in C#. For this example, lets say I have 2 aggregates, Customer and Product. My aggregate repository ...
0
votes
2answers
247 views

CQRS, Where exactly is business logic that coordinates between aggregates?

Where exactly to put business logic. While everyone said put it in the aggregate. Yes, But what if business logic need datas of multiples aggregate? Or if business logic need to update multiple ...
1
vote
1answer
603 views

Serverless event-sourced architecture using AWS offerings

This is my first post on the Software Engineering Stack Exchange so let me know if something is wrong with it. I'm looking into the serverless offerings of Amazon to try to figure out if that is the ...
0
votes
2answers
98 views

Would it be OK if I mention actor in the command/query name when I use CQS pattern

I'm applying Clean Architecture + DDD (maybe) in my project (web Application + REST API). The good thing I learned from the Clean Architecture is using "Interactors" to show business use cases in my ...
1
vote
2answers
248 views

Can command handlers be separated from aggregate roots in CQRS

On one hand, the invariants should be protected (To make invalid states impossible early and preferably at compile time rather than run time), and on the other hand, passing domain knowledge out of ...
6
votes
1answer
769 views

CQRS-Event Sourcing: how to process events in the expected order inside the read model

I'm looking for some insights about how to handle the read model in a CQRS Event Sourcing application, in order to do the best to ensure data consistency. The missing point is how to be sure (...
3
votes
3answers
765 views

CQRS+Event Sourcing as Top Level Architecture: Anti-Pattern

I have been study DDD along with CQRS and Event Sourcing. I recently listened to a talk Greg Young gave a couple years ago where he said that CQRS and Event Sourcing are not a top level architecture ...
2
votes
3answers
440 views

Why “Event sourcing an entire system is a big mistake and considered an anti-pattern”?

Why event sourcing an entire system is a big mistake and considered an anti-pattern? And what situation it's consider an anti-pattern? Reference 1 Reference 2 Updated Question : Still don't ...
0
votes
1answer
49 views

How should “preparation” and “usage” of the same data be separated in a DDD application, if at all?

In most domains, there is an app that "prepares" data, and another app that "serves" the prepared data. The data, however, is from the same Core Domain, which causes some confusion in modeling. Some ...
0
votes
1answer
70 views

CQRS, Should I have bidirectional aggregate reference?

Suppose we have domain Character and Player. Character owned by Player. Player PlayerID : GUID OwnedCharacterIDs : Guid[] Character CharacterID : GUID OwnerPlayerID : GUID While my ...
0
votes
1answer
127 views

CQRS, What reasons cause read model update delay? How to prevent user from taking inconsistence data?

I am considering CQRS for building a realtime game server (not gameplay but the economy). For some reasons. Scaling, Event logging, Model changing. However in realtime game when player upgrade, for ...
-1
votes
1answer
427 views

CQRS, How to query aggregate root using others fields rather than GUID (ID)?

There are many CQRS frameworks and event store libraries. All of them use GUID as aggregate root's ID. Those event store only let me query only by GUID. I realise that there are many times in last ...
2
votes
4answers
377 views

Does CQRS need to be fire and forget, If we need to read guarantee after command?

I'm in researching phase of CQRS+ES. Never done in real world yet. But very soon. However what I saw in StackOverflow and projects, CQRS seems to be fire and forget. So what if there is a chain ...
7
votes
2answers
762 views

Zero argument constructors and Always Valid entities

I have done a lot of reading recently about Always Valid domain entities. I have come to believe that in order to ensure the entities are always valid I need to: 1) Remove primitive obsession and ...
0
votes
2answers
768 views

How to store Sagas with Event Sourcing

I have a long running process that collects together the IDs of Aggregates that have been edited/changed, so that a later command can 'publish' them to a legacy model. I understand that I should use ...
3
votes
4answers
252 views

Too many unecessary events

I'm new to eventsourced apps and since the beginning I'm facing an issue that I'm unsure how to resolve. I work in ecommerce and I always try to convey meaningful events to my aggregates like ...
2
votes
1answer
409 views

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. ...
2
votes
1answer
136 views

High scale architecture using Event Sourcing and Eventual Consistency

I want to share with you and know what your opinion/improvements are regarding a solution I was tasked with a technical interview I faced. The exercise: You need to create an API which will indicate ...
0
votes
1answer
27 views

Evaluate http reqres vs websockets for geolocation based broadcasts

My use case is that I have a real-time broadcast app where users get feed items based on a geolocation, i.e. a user will receive posts that were broadcasted from within a user-defined radius where (s)...
0
votes
2answers
440 views

Designing events in an event-driven (event sourced) architecture and managing duplication

I have been creating a POC for a part of our system but I'm finding some trouble communicating some of the ideas behind it. This takes ideas from Event Sourcing and Event Driven Architecture but ...
2
votes
1answer
678 views

Can CQRS pattern exist without mediator pattern?

Can CQRS pattern exist and/or work without mediator pattern? I mean there are always commands and these commands have to be dispatched somehow to the handlers that perform some logic on them. Does ...