Questions tagged [cqrs]

Command-Query Responsibility Segregation (CQRS) is an architectural pattern which separates commands (that change the data) from queries (that read the data). See 'about cqrs tag' for more details and references to learning materials. Not to be confused with Command-Query Segregation ([CQS]), a principle of object method design which CQRS incorporates.

Filter by
Sorted by
Tagged with
1 vote
1 answer
43 views

Fluent Validations - How to reuse rules for a property?

Iam using Fluent Validations with CQRS using MediatR library. The following Fluent package versions are used in my solution along with .NET 7 & C#. FluentValidation - 11.8.1 FluentValidation....
Bhanu's user avatar
  • 915
0 votes
1 answer
47 views

Is Combining Event Store and Event Bus Recommended in DDD with Event Sourcing?

I'm currently exploring Domain-Driven Design (DDD), Event Sourcing, and CQRS. I'm seeking clarity on whether it's advisable to use a single component for both the Event Store and the Event Bus. There'...
Joud Awad's user avatar
1 vote
1 answer
46 views

Differentiation between Synchronous Domain Events, Asynchronous Domain Events and Integration Events

While studying about Domain Events and Integration Events, I came accross articles that tend to refer to asynchronous Domain Events as Integration Events. My understanding of Domain Events was that ...
Yamin Nather's user avatar
1 vote
2 answers
37 views

Question about how to trigger Projections

I'm learning CQRS and common tactical DDD patterns and I'm kind of confused about how to trigger projections that's in another microservice. For learning purposes, I'm not using Event Sourcing right ...
Yamin Nather's user avatar
0 votes
1 answer
36 views

How would you handle queries in CQRS?

I am in the process of learning Microservices and I'm learning to implement them using popular Domain Driven Design tactical patterns and CQRS. For my first project I'm trying to create a simple ...
Yamin Nather's user avatar
0 votes
1 answer
28 views

Is Version Attribute In Aggregate Class Leaking Event Sourcing Details

I am building an application that follows a clean architecture approach. It tries to ensure the domain layer is independent of any infrastructural layer. But I'm looking at a lot of examples that ...
alaboudi's user avatar
  • 3,257
2 votes
1 answer
43 views

How to do Unit Testing for a controller structured upon Clean Architecture and CQRS?

I have a Product API for which I mean to do Unit Testing via xUnit.net and Moq. I'm totally new to Unit Testing btw. I've seen a couple of videos on Unit Testing for controllers via Repository pattern,...
Aboliii's user avatar
  • 47
-1 votes
0 answers
30 views

MediatR Query with a List field

I have a object with a list field ` Class Foo { int Id {get;set;} List<Bar> bars {get;set;} } ` i create the query obj ike so - no issue here ` public record GetFooBarQuery(int FilterId)...
mg3's user avatar
  • 119
-2 votes
0 answers
24 views

CQRS in ASP.NET MVC

I am trying to implement CQRS in ASP.NET MVC application But It didn't work can anyone help me how to implement CQRS in MVC. I need Aswer how to implement CQRS in MVC. please answer my question I have ...
Zeeshan Asgar's user avatar
0 votes
0 answers
54 views

Event Drive Architecture, CQRS and Write Database Model

I am diving deeper into CQRS and Event Sourcing Architecture and I am a bit confused about loading WriteModel/Aggregate into service. In my current state I am pushing all event to EventBus (Kafka) and ...
TrassaTeusz's user avatar
1 vote
2 answers
34 views

CQRS - validation current state of aggregate

Could you help me with a shopping cart use case? I use CQRS (Axon framework). I have got an aggregate ShoppingCart with command and event handlers AddProduct, ProductAdded, RemoveProduct, ...
user3227507's user avatar
0 votes
1 answer
32 views

Is it acceptable to store state events in addition to action events with the event sourcing pattern?

Considering the following scenario: An event sourced aggregate manages the transport of a package It can receive commands such as "Package loaded at 5AM", "Package stopped here at 7AM&...
Simon Watiau's user avatar
0 votes
1 answer
34 views

Event sourcing : updating an event data

i'm stuggling with one scenario in the event sourcing. i have and order picking system which allows to prepare orders. i registered order prepared event with pickedQuantity > requestedQuantity i'm ...
user2530251's user avatar
0 votes
0 answers
59 views

Use separate databases for command and query micro-services with Axon framework and Spring Boot

I'm trying to implement CQRS and event sourcing patterns with Axon framework and Spring Boot. I created two services with two separate databases (for simplicity, I used two PostgreSQL databases on ...
hamed's user avatar
  • 114
0 votes
1 answer
40 views

Event Handler of Spring boot project does not capture the Event in Axon Framework

I tried to implement a simple microservice with CQRS design pattern. i used axon framework and spring boot 3.1 for develop this. I divided query and command services into separate projects. At that ...
Yasiru Wickramanayake's user avatar
0 votes
1 answer
38 views

Entity instance cannot be tracked because another with the same key value is already being tracked. DDD + CQRS + EF Core

I am more or less following Microsoft's DDD and CQRS patterns example (eshopOnContainers app) to build my application. I have the following main components: Application Layer/PostTransactionService ...
Serge's user avatar
  • 31
0 votes
0 answers
9 views

Response object in spring microservice cqrs

I am writing login endpoint in spring microservice cqrs. But how can I get the data of the user object and token from the command to respond to the client? @PostMapping("/login") public ...
An Nguyen's user avatar
0 votes
1 answer
24 views

Cross-aggregate projections

I am new to the world of CQRS and event sourcing, trying to evaluate whether it would suite my case. I would appreciate suggestions on how you would do a cross-aggregate projection. I am thinking ...
Artem's user avatar
  • 776
1 vote
0 answers
34 views

How to implement generic ValidationBehavion using MediatR and FluentValidation so that the ValidationBehavion only triggers on commands

I'm using CQRS and to separate commands and queries I created custom interfaces, so I want my ValidationBehavion to trigger only on the custom ICommand<TResponse> inheriting IRequest<...
Maks0s's user avatar
  • 11
3 votes
0 answers
173 views

Nest JS Command Bus (CQRS) Multi tenancy , Dependency injection

I have Nest JS application with typescript. Recently I had to update this application to use multi tenancy where my main requirement is to connect different database based in tenanId (I know multiple ...
Abhishek's user avatar
  • 1,002
1 vote
2 answers
237 views

Where to imlement complex queries in Clean Architechture and DDD with a single database for commands and queries

I'm trying to follow clean architecture principles, where when I try to keep implementation details regarding persitence out of Application Core: The repository interfaces are in Application Core ...
Liero's user avatar
  • 25.6k
1 vote
1 answer
251 views

Where do I place complex business logic when using the Clean Architecture and Mediator patterns in the Application layer of a .net core application

I recently switched to using the CQRS and Mediator pattern for my in ASP.NET Core application. My entire application is using clean architecture best practices (Domain, Application, Infrastructure, ...
Blake Rivell's user avatar
  • 13.3k
0 votes
0 answers
28 views

What is the best practice for indicating / rendering error and success in a Blazor Server app with external calls?

This is more of a general question than a Blazor specific one. I am writing a Blazor server application which serves as the UI for CRUD operations on data in my SQL DB. These CRUD operations are ...
tri-catch's user avatar
0 votes
1 answer
61 views

Best Practices for Designing Domain Models with Calculated Properties in DDD & CQRS

I'm currently developing a system following Domain-Driven Design (DDD) principles, and I've run into a design challenge that I believe others in the community might have faced. In my domain model, I ...
Denys Doskach's user avatar
0 votes
1 answer
90 views

Why CQRS is called as MicroServices Design Pattern and Not Monolithic Design Pattern?

The CQRS pattern splits the application into two parts: the command side and the query side. The command side handles create, update, and delete requests. The query side runs the query part by using ...
priyanka's user avatar
  • 422
2 votes
1 answer
101 views

Overload CQRS pattern with multiple database calls

I am working on a .NET 6 project with EF core 6.0. The project is build using Clean Architechture and CQRS pattern. My question is more general and I am looking more for opinions rather than straight ...
Plamen Michev's user avatar
0 votes
0 answers
40 views

CQRS Design Pattern

Apologies if there are existing threads that I miss. Please point me to right one. I designed a system using cqrs and into different microservices. Example: A1,B1 microservices -> commands, ...
FatBoiEgg4's user avatar
0 votes
1 answer
22 views

How to migrate a PUT endpoint to a command based app (event sourcing)

I'm almost done with implementing event sourcing using CQRS module of NestJS, but now there is something I don't know how to handle. Currently, I have cron jobs that send transactions hourly to a my ...
Paul Serre's user avatar
1 vote
1 answer
104 views

SimpleInjector MediatR scope lost

Within a Blazor server application I do use the Simple Injector integration as well as the MediatR. The Simple Injector looks like it works pretty fine together with Blazor with respect to the scoping,...
Jan Drozen's user avatar
1 vote
1 answer
226 views

How to avoid almost repeatable model in clean architecture and make code follow DRY principle and dependency rule?

I building an e-commerce project using a clean architecture that has 4 layers as follows - Application layer UI Layer Domain layer Infrastrucure layer Also using the CQRS pattern in the application ...
sarang lad's user avatar
0 votes
1 answer
164 views

NestJS CQRS module: Event handlers not called when I register a EventPublisher

I'm using CQRS module of NestJS. I just want to be sure about something. I've created a custom EventPublisher that has a publish method. This method just publish the event in my database. @Module({ ...
Paul Serre's user avatar
0 votes
1 answer
62 views

FluentValidation conversion error using MediatR and C#

I am having trouble returning the response from my response class, which has the FluentValidation validations, it shows me the following error message: This is my request class, public class ...
Ing. Jose Valera's user avatar
0 votes
2 answers
107 views

Where does "current state" is stored in event sourcing?

I understand cqrs, but I'm having problems with a part of event sourcing. Everyone says "You don't store the aggregate's current state, you store the sequence of events that were applied to that ...
stackoverflower's user avatar
0 votes
1 answer
56 views

Where should Third Party Service Event Subscribers and Email Notifications be in an CQRS-ES system?

I have been developing a CQRS-ES system for a few years now and have read a lot of the literature out there, but I still can't seem to understand where third party service updates and other side-...
Giles's user avatar
  • 1
0 votes
2 answers
58 views

Can we completely avoid synchronous approach between microservices?

1)If 2 microservices (say order and payment services) can connect asynchronously, then we can avoid using circuit/retry/throttle patterns, right? I really dont understand why going synchrnous ...
john's user avatar
  • 15
0 votes
1 answer
27 views

MongoDb, inserting, _id and CQRS

I'm writing an application in node.js using mongo as database. One of my use case is add object to the tree (whole data structure of this tree is store in mongo). So whole operation is quite simple: I ...
Mateusz's user avatar
  • 11
1 vote
1 answer
252 views

How to manage update command using CQRS pattern for multiple scenarios?

I am using the CQRS pattern and have come across a scenario where I need some help. To understand the issue let's say we have an entity User which has UserId, FirstName, LastName.... in an application ...
Imran Yaseen's user avatar
1 vote
0 answers
574 views

How to implement vertical slice architecture in C#

I am working on a new project and I am interested in using the vertical slice architecture pattern. However, I am not sure how to implement this pattern in C#. Can someone provide an explanation of ...
Ahmed Zlazel's user avatar
1 vote
1 answer
92 views

Single processor of NATS subject

I have multi-tenant system, where each tenant is client with its own view of the world, own entities, catalogs etc. I want to partition all "command" messages so that all commands ...
Twice_Twice's user avatar
0 votes
4 answers
184 views

Event Sourcing and CQRS: Handle concurrency with multiple "read model consumers" instances

I'm implementing a solution based on Event Sourcing and CQRS patterns. In my use case I have: A WRITE microservice: Where events are appended to a particular Stream (let's call it X Stream) stored on ...
javacomelava's user avatar
0 votes
1 answer
75 views

Managing read state in event sourcing: How to prevent duplicate data when adding new events?

How does one manage read state within an event sourcing infrastructure ? Lets say I receive a new event to add a user. Before I can add the user to the event store I will need to ensure the user does ...
thef2theg's user avatar
0 votes
1 answer
42 views

What approach to use when generating qr code in CQRS architecture?

I need to generate a qr code in my web api and save the data encrypted in the qr code to the database. I have an action method in my controller GenerateQrCode which should generate a qr code through ...
philomelka's user avatar
0 votes
0 answers
81 views

IEnumerable List appear empty in request command when Using mediator cqrs pattern from swagger gen

I have to post Circulum Vitae info to Db for that i created a Entity Circulum vitae : public class CirculumVitae { public Guid UserId { get;set; } public IEnumerable<Skills> Skills { ...
AZZOUNI MOHAMED AMIR's user avatar
0 votes
1 answer
237 views

Event Sourcing with Python: How do I make a projection?

I'm trying to learn the event sourcing design pattern. And I am using the python eventsourcing library. I've worked through the "Dog School" tutorial, but it isnt clear to me how to make a ...
d s's user avatar
  • 21
-1 votes
1 answer
1k views

System.AggregateException: Some services are not able to be constructed

I'm writing a project on ASP-NET Core using the MediatR 12.0.1 library. I'm new to .net 6 and I'm learn Dependency Injection. Structure using Application; using Application.Common; using Domain; using ...
Virro Harrou's user avatar
0 votes
1 answer
36 views

How can I get amount of users created in the last 24 hours in an event sourcing system?

I am learning about event sourcing and projections, and something that I thought should be simple apparently it is not. Context I have an application using event sourcing. Users are created and when ...
Hector Ordonez's user avatar
0 votes
0 answers
65 views

Mocking multiple MediatR sends in one comon handler

I have an AssetMovement MediatR handler, where I insert a new assetmovement documnet. This action also affects two other tables; I have to update the asset avalability and insert the new location of ...
sada's user avatar
  • 614
0 votes
0 answers
35 views

How do we handle faster microservices that may process events quicker and produce new events sooner than slower microservices in event sourcing

If I have 2 microservices that produce events where one is sometimes faster while the other is slower. In order to ensure deterministic replay in the system is the solution to use a central sequencer ...
Androiduser14919 Starters's user avatar
1 vote
2 answers
47 views

EventSourcing+CQRS validations

When using EventSourcing and CQRS you usually have eventual consistency in your read models. Let's say we have a Customer entity which is eventsourced and this entity has a social security number ...
rbasniak's user avatar
  • 4,606
0 votes
1 answer
220 views

How to describe Dependency Injection using UML diagrams?

I'm trying to create a UML diagram showing the Mediator and CQRS patterns implemented in ASP.NET Core using the MediatR library. This is what I've come up with so far: The use of "..." ...
Ari's user avatar
  • 1

1
2 3 4 5
40