Questions tagged [cqrs]

Command Query Responsibility Segregation design pattern

Filter by
Sorted by
Tagged with
-1
votes
3answers
63 views

How can I coordinate updating multiple Aggregates as a result of one command, without introducing exploitative possibilities?

I'm trying to figure out how to integrate one command that updates multiple Aggregates in different contexts in a video game. The components/considerations for my particular design are DDD, CQRS, ...
0
votes
1answer
59 views

How can I orchestrate multiple business tasks?

I have a WebApi backend with a Blazor WASM frontend. The application is split up into 3 main parts. Core, Infrastructure and Presentation. Basic onion architecture structure. Core.Domain Domain ...
0
votes
1answer
40 views

Query authorization in read model for listing items in DDD/CQRS

In my example app there are admins and modules. Each admin may have some permissions to access a module. Also please note that I am assuming "simplified" DDD/CQRS where read models are ...
0
votes
0answers
43 views

In CQRS is it acceptable for an event handler to access a query?

This question is somewhat linked to Should CQRS Command perform a Query? where there is a detailed discussion which in summary indicates that when using CQRS, Commands and Queries should not call ...
1
vote
2answers
89 views

Data Repository and Complex Queries (DTO)

Following the classic 3 layer architecture domain Model (a list of entities live there and has no dependencies) DAL layer - My Repositories lives there with DBContext implementation (Ado.net) Dal ...
-3
votes
1answer
73 views

Comparison of CQRS and MVC

Command Query Responsibility Segregation and Model–view–controller patterns look pretty similar to me. Are they comparable? Do they act at the same layer of abstraction? How do they differ? Can they ...
3
votes
2answers
102 views

How can we update potentially many Read Model Projections based on an Event that is not within the native context?

I have a Shop which sells Items for a given Price. To be clear, this is in the context of a video game, not an enterprise ERP system. The game operator can create Shops that Players can use to buy ...
0
votes
1answer
89 views

In an event sourced system, how do I get a current state of an entity?

Let's assume I use Kafka as an event store and put there all the lifecycle events of an order. Now I need to get the current state of this order in my system in during some business process. What's ...
3
votes
1answer
150 views

DDD and CQRS in web applications

Premise A web application that has a frontend / backend separation. The frontend can be the JS framework of the month, which talks to a REST API in the backend. The backend part of the system accepts ...
0
votes
0answers
38 views

How to name multiple entities returned from a Query Handler?

I've got the following flow: HTTP API is exposing data from 2 database tables that are combined into one JSON structure. We're implementing this using CQRS - splitting the reads from multiple tables ...
1
vote
1answer
107 views

Upholding business logic and invariants in an event sourced CQRS architecture

My understanding of a CQRS architecture is that a micro-service is split to two servers each with its own database such that the first server handles all the writes and the second server handles all ...
2
votes
1answer
111 views

Event Sourcing - More complex example

Usually when I read Event Sourcing examples - they are pretty simple. When trying to implement something even more complex - it seems to get pretty ugly pretty quickly. Let me explain this on one ...
2
votes
1answer
203 views

Moving shared CQRS/Mediatr Request Handler logic into services and avoiding code/logic duplicity?

We recently embraced Clean Architecture and CQRS, by way of Mediatr, in several of our new applications. A similar (SPA-based) demo can be seen here. For many of our WebApi-based projects, this worked ...
0
votes
1answer
187 views

Primitive obsession, value objects, Commands, Events and where to convert

I tried to combine two rules. Don't fall to primitive obsession (e.g. EMailAddress should be a value object in domain objects and not a string). Don't use value objects in commands and events.1, 2, 3 ...
1
vote
0answers
23 views

Specifications Pattern crossing bounded context - Domain Driven Design

I'm trying to understand and implement with good practice the Specification Pattern within my domain driven design project. I have few questions: For example: verifying that a customer is subscribed ...
-3
votes
1answer
88 views

How to get Address pincode inside Customer class

I have 2 domains Customer and Address using using EventSourcing and CQRS in our Monolithic app, below is my query: Customer Domain: class Customer { //Aggregate class String custId; ...
2
votes
2answers
127 views

In which database CQRS Command performs a Query?

I read the discussion Should CQRS Command perform a Query? But I don't understand in which database the query is performed, because I have two distinct databases - one for reads (queries) and one for ...
1
vote
1answer
61 views

designing events for an event sourcing based application

In an application to handle employee leaves, I decided to try CQRS & event sourcing and came up with the following flow of events. app events leave-application-received leave-application-...
2
votes
3answers
385 views

Event Sourcing - Multiple events or a single for a change on one aggregate?

I have a checklist system where we are implementing CQRS/ ES (Event Sourcing). We have a command updateStatus(taskId: string, status: boolean) to mark a task or sub task as completed. If I receive a ...
1
vote
1answer
91 views

DDD bounded context between three Aggregates that share the same address entity and CQRS

We have many different aggregates that use an address entity. But we also have an address aggregate because we have a global address book as well. Aggregate Company has many Address Entities ...
2
votes
1answer
152 views

Event Sourcing/CQRS for Self-Related Entities

I'm building a platform that has an entity named content. There's a clear boundary around what defines content except that it can have relationships with other content entities. Up until now, there's ...
0
votes
1answer
84 views

CQRS for avoiding heavy joins

I've been wondering about what is a perfect use case for CQRS where the benefits overcome the complexity and the cost with come with the package. So for me to better understand it, I want to share ...
2
votes
3answers
437 views

What are the problems with command handlers returning data in CQRS?

I have a system using CQRS/ES, where: The command handlers are actually implemented as an application service layer, which executes synchronously. I.e. events are persisted in the event store before ...
2
votes
2answers
145 views

Entity delete validation in a microservice environment

In a microservice environment there are two services: Service A and Service B. Service A manages an entity called x which has one to many relationship with service B's entity called y When a network ...
1
vote
1answer
117 views

DDD - Concurrency and Command retrying with side-effects

I am developing an event-sourced Electric Vehicle Charging Station Management System, which is connected to several Charging Stations. In this domain, I've come up with an aggregate for the Charging ...
0
votes
0answers
144 views

CQRS denormalized data query with multiple aggregates

Let's say there's a domain that's similar to Reddit. Aggregate roots are Board // you can ignore this - boardId Post - postId - userId User - userId - username where each aggregate emits ...
-1
votes
2answers
106 views

Merging aggregates with Event sourcing

I'm currently evaluating Event Sourcing and CQRS for an implementation of a new business requirement at my day job. While I can't really speak about the actual business problem, I can give a few ...
0
votes
1answer
63 views

Message bus: should an event handler trigger other commands?

Given I have a message bus that can handle commands and events. A command handler can dispatch an event. But should an event handler be able to dispatch another command? Or should event handlers only ...
-2
votes
3answers
485 views

How does “event triggers event” really work in Event Sourcing / CQRS?

After reading/watching a lot about Event Sourcing, there is one thing I don't fully understand: Events that lead to triggering of other events. Let's take StackExchange's "close question" feature as ...
0
votes
0answers
37 views

Read models creation, maintaining in stateless sevices CQRS

In a microservices based web backend, most of the services (Node.js) contain modules to handle read and write data separately. When that particular service restarts it grabs the data from other ...
-4
votes
1answer
39 views

What do you store first in a CQRS + ES architecture

I've recently started reading about CQRS, DDD and EventSourcing. From what I've read one of the best ways to do ES is to have an event store and then a regular DB or cache for easier querying. However,...
-1
votes
1answer
41 views

Does logged-in User information belong on a Command?

Imagine I am creating a command called UpdatePhoneNumberCommand. Imagine also that in my application a business rule dictates that no-one may update anyone else's phone number - it is always you ...
2
votes
1answer
763 views

Event sourcing and sync between write and read model

I am creating this project based on event sourcing and cqrs. My write and read model are on different databases (and machines) and are connected through an event bus (in particular I am using ...
1
vote
1answer
97 views

Designing frontend experience to support backend async CQRS operations

I'm developing a microservice with CQRS and Event Sourcing. When an event is saved to the event store, the service currently also saves the updated aggregate root as a JSON object in a separate table. ...
2
votes
2answers
630 views

CQRS - How can a command properly validate when queries are required?

I'm aware that this question has been asked several times, but I have some concerns regarding querying from the write side that I don't see addressed in the already existing questions, more ...
0
votes
2answers
168 views

Modify Command object inside decorator of CommandHandler(CQRS) or any other practice for avoiding duplication

Currently, we have multiple commands which share two same properties (BookName and ShopId). While handling those commands those properties must be validated with the help of some service. Let's say ...
2
votes
1answer
383 views

Determining an appropriate use case for CQRS

I'm building an application which lets users view a large amount of data about a single single entity (lets say it displays a users health profile for the day) via a single webpage. The data comes ...
2
votes
0answers
45 views

Event sourcing and state set event

I'm trying out commanded framework for Elixir that implements event sourcing and CQRS (it have abstract structure of command, command middleware, router, aggregate, process manager, projection and ...
0
votes
0answers
60 views

Is one to one mapping necessary between Write Applications and Read Applications

Introduction: We have a bunch of micro services (about 40) to serve our customers. To facilitate scaling and audit-ability of selected few micro services we have decided to redesign them using CQRS ...
1
vote
0answers
375 views

DDD Monolith eshop architecture based on multiple BoundedContexts Question

I´m creating my first eshop / CMS based on DDD / CQS concepts. I want to create application using BoundedContexts separtion as modular monolith at the first stage and maybe latter extract some BC as ...
2
votes
1answer
765 views

Reducing the code duplication between read and write application in CQRS

I am building an application and trying to embrace Domain Driven design principles, CQRS and event sourcing. We are having two applications one for reading and another for writing. The write ...
2
votes
1answer
215 views

ES/CQRS: How to access additional information in projections

I'm developing an event-sourced/CQRS application and do not understand the best strategy to use when building the read model projections when additional domain data is needed. A partial representation ...
2
votes
2answers
821 views

Dealing with property-level permissions in DDD and should UI or authorization influence the domain model?

Suppose I have a command like below: public sealed class UpdateExampleCommand { public int Field1 { get; set; } public string Field2 { get; set; } public bool Field3 { get; set; } ...
2
votes
0answers
55 views

Commiting transaction in the repository instead of the application service

After quite some time thinking about it, and testing both methods, I'm really struggling with choosing the right manner to commit my transactions. To shape the context, we are in the context of ...
2
votes
1answer
53 views

How specific should administrative compensating events be in a CQRS/ES system?

Are there any best practices around how specific to make events that are generated administratively, say to clean up after one-off operational issues? For example: Say you have a credit card ...
3
votes
2answers
669 views

How to deal with UI data requirements in DDD

I'm using DDD and a CQRS/Event Sourcing architecture so my domain logic is separated in a microservice (e.g: command service) and the read side is in another microservice (e.g: query service). We ...
1
vote
1answer
273 views

Is it overkill to use event sourced actor model with message queue which send commands from gateway?

The gateway uses Rabbitmq with Masstreansit to send commands to services. Some of services require event sourcing in their internal architecture. Since I need my aggregate states available, and the ...
0
votes
1answer
343 views

What is the most appropriate way to launch an API gateway on a massive domain?

We're trying to develop a comprehensive system which has broken down to multiple microservices. So we decided to use CQRS and DDD to tackle the complexities of the domain. Also we’re about to launch ...
2
votes
0answers
56 views

Should perform query at the point of time for the event or the actual time when working with CQRS for queue system?

I'm trying to implement CQRS for a queue system where user can join a queue by clicking a button. The system will tell the user if queue is full. When the user click the button, it raised the ...
2
votes
1answer
319 views

How to split Aggregate Root that have equal identity?

In DDD, creating smaller aggregates is encouraged where possible, but in a system we are designing we are running into an issue regarding the identity of aggregates. The system evolves around ...

1
2 3 4 5