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
0answers
31 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
41 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
70 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 ...
1
vote
2answers
37 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
44 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
45 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
10 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
84 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
305 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
44 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 ...
2
votes
4answers
193 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
57 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
144 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
51 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
0answers
29 views

AggregateRoot implanted as Akka Actor

I am building new product on Akka. I would like to use DDD and CQRS. Let’s say that I implemented UserRepository as actor, that gives me CRUD functionality but I lose user events for example when ...
0
votes
2answers
157 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
166 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
1answer
43 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
159 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 ...
3
votes
1answer
310 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 (...
0
votes
2answers
451 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
338 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
46 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
57 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
97 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
236 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
200 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
508 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
358 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
238 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
206 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
119 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
24 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
258 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
316 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 ...
1
vote
1answer
86 views

Passing Meta info from Command through Aggregate to Event

I have a CQRS system in development that passes the Command to a CommandHandler, which gets an Aggregate from a Repository, and calls a method with the properties of the Command (converted to ...
2
votes
1answer
58 views

CQRS with sub methods that are used in more than one place

I have a situation where some commands are using some common methods. These were originally developed in one command and are now helpful to other commands, they can be static and are self contained. ...
3
votes
1answer
241 views

eventsource/CQRS - Replaying projections of an aggregate in order

I have a eventsourced project and I want to replay the following two events, in order: ProductCreatedEvent PriceChangedEvent I've been told that projections should be asynchronous, so when replaying,...
2
votes
1answer
326 views

How are CQRS write models initially populated?

I have a system that interacts with a REST API as the data source. This system is based on DDD and all of my current models are CRUD models. There is one model that the REST API is only able to query ...
3
votes
2answers
276 views

CQRS async query from command handler

In a CQRS/async microservices context, I have a command handler e.g. SendOrderConfirmationEmailCommandHandler implemented in a communications service. This depends on information from the orders ...
-2
votes
1answer
109 views

Modeling sprint and ticket in DDD

I'm trying to learn DDD/CQRS in a hobby project. And have no prior experience. In this project I use MongoDb as a read db and EventStore as a write db. I'm building a simple 'Sprint board' ...
0
votes
3answers
579 views

DDD: Event handlers and aggregates in functional programming

When implementing a DDD driven system (based on event sourcing) using a functional programming language (Clojure), should one separate event handler functions from aggregate functions? In my naive ...
3
votes
3answers
168 views

With event sourcing, how to get the response of a call that is a side-effect?

Let's say my user requests my ES/CQRS system to open a support ticket: The controller sends an ask-support command, this command checks if the user has enough credit to do that, then emits an asked-...
1
vote
2answers
171 views

Recovering the state of the Write Service in an Event Sourced system

Quick question, I've been digging into CQRS and Event Sourcing and there's one thing that I have not been able to find info on, what happens when your Write Service crashes and you need to start it ...
6
votes
2answers
191 views

CQRS in Collaborative Domains

I am reading this article about CQRS, and when it comes to decide where to use it, the following didn’t really get to my mind: Collaborative domains where multiple operations are performed in ...
1
vote
3answers
680 views

In CQRS, is it okay to call external services from Sagas/Process Manager?

In my domain where I am applying CQRS, there are some external service calls in order to some validation. I am a bit puzzled about where to put these calls. I am considering to put these calls to my ...
2
votes
1answer
235 views

CQRS, microservices and delta replication

We have a micro-service that has a Domain Model and have an analytical service for the domain which has its own Query Model. The domain model and the query model are stored in separate persistencies. ...
1
vote
1answer
360 views

Should I use NoSQL or RDBMS for materialized view in this CQRS / ES implementation?

I am going to try to build a implementation of CQRS and ES for large scale application (1M users) authentication API. Below is my initial architecture draft (Ignore Azure related stuff). I am going to ...
2
votes
2answers
666 views

CQRS, Event Sourcing and (near) Real Time Reporting

I am working with a small team that is developing a CQRS/ES "semi-microservice architecture. We are pretty far along, but running into some interesting challenges with our projections and further ...
3
votes
1answer
533 views

Using Event Sourced Aggregate Roots with the Specification Pattern

I have a Aggregate Roots that use the event sourcing technique of being built from a series of events in a Repository. This is all great for when I just need to manage change of state etc, but when I ...