Questions tagged [event-sourcing]

Architectural pattern that manages the current state as the result of a sequence of events that are captured and stored and each trigger a state change.

Filter by
Sorted by
Tagged with
2 votes
3 answers
206 views

How to implement HATEOAS with CQRS?

Let's say I have a CQRS system where my write model contains the business rules. My read model is simply a DTO; it is a collection of properties and "dumb". Now if you were to create a REST ...
0 votes
2 answers
107 views

How do event sourcing services recreate the state of an entity?

I'm reading about event sourcing and have a question regarding the recreation of an entity state. For a simple scenario, lets say we have Order events such as OrderCreated / OrderUpdated / ...
0 votes
0 answers
18 views

Using SchemaRegistry for JSONSchema for a protobuf field

Currently, I am working with an upstream service which uses the protobuf serialization to publish events to pulsar where they are consumed by a downstream service. Going forward, we have decided to ...
0 votes
0 answers
82 views

How to model an event-driven system for replays

Let's say I have a system to which I can upload documents via an API. There are three services: the UploadService - responsible for providing a HTTP endpoint the StorageService - responsible for ...
0 votes
0 answers
23 views

Trigger function on a certain aggregation of data?

I'm trying to design a reward system which will coupons and extra benefits on unlocking rewards (referral reward, first_order_reward etc). First I tried to make master (reward) and detail (user_reward)...
1 vote
1 answer
103 views

"Protect" published events using auth, Event driven architecture

I have a system that publishes events to a message broker, lets call that system A. I also have system B and system C that subscribes to the "events"/messages. My payload/message looks like ...
  • 203
-1 votes
1 answer
135 views

Checking a related aggregate existence is Domain concern?

This is my specific situation: I am following DDD and Event sourcing to implement my application (using C#). I have a Domain layer that contains Aggregates' implementation. I write unit tests for this ...
  • 99
0 votes
1 answer
64 views

How to get analytical information from a microservices system?

In an event-driven microservice architecture, imagine we have three services: Customer service Order service Item service Each service raises an event with data when something happens and stores ...
  • 129
0 votes
2 answers
134 views

Event driven architecture conditional logic

As this article explains the way to deal with persistent state in an event log driven architecture is to have some "microservice" subscribed to events and be responsible for maintaining that ...
1 vote
1 answer
91 views

What to improve/change and how to move forward with my Event Storming session?

I'm doing alone session with Event Storming for my application that I plan to build with DDD approach later on. Event Storming session is for learning purposes. My application domain logic is rather ...
0 votes
0 answers
40 views

DDD & ES – modeling crossing context between domains

I've been experimenting with DDD, CQRS and Event Sourcing recently as part of a small application I'm writing for my own use. Unfortunately, I'm not quite sure how to play some things out correctly ...
  • 1
0 votes
1 answer
77 views

Is publishing to the same event store stream from multiple places an anti pattern in a distributed transaction?

Below is a little context to the problem I'm trying to solve. There are two separate microservices with separate frontends , APIs and databases. Customer Microservice - Manages customers Orders ...
  • 302
2 votes
1 answer
142 views

How do we maintain consistent-read promise to clients + handling ID collision when using a fallback queue?

In my company, we are using Event Sourcing pattern to implement a storage for all changes to the price of a booking. Across the company, different services might try to append events to a booking ...
  • 245
0 votes
1 answer
113 views

How to publish single event from multiple services

Let's say I have a system that parses network traffic, and generates event of things that happened. example: ip1 was talking to ip2 ip2 was talking to ip3 etc Now let's say that these events are ...
3 votes
3 answers
156 views

Coping with lack of infinite retention event broker in event driven architecture

I am reading “Building Event Driven Microservices”. It states a requirement of the event broker is: Infinite retention: Event streams must be able to retain events for an infinite period of time. ...
  • 109
1 vote
1 answer
175 views

Event Sourcing inside a RDBMS

I'm thinking about using an Event Sourcing / Event Store pattern in my RDBMS designs. What I mean by Event Store is a pattern where each data mutation (INSERT / UPDATE / DELETE) is persisted as an ...
  • 111
0 votes
0 answers
120 views

Saga / Processmanager?

I'm thinking about this scenario: I can receive customer inquiries by Email. Those inquiries can be sent from existing customers or unknown "customers" - I'll call latter "Leads". ...
  • 1
2 votes
2 answers
123 views

Event Sourcing questions

I have a question regarding the architecture of microservices and event sourcing. Imagine that I have the User service and the Franchise service. In the Users entity on the user service I have an ...
0 votes
1 answer
192 views

Are RabbitMQ Streams overkill for 1 machine event-driven architecture aplication?

If developing event-driven application(more precisely event sourcing application) that will run solely on 1 machine are RabbitMQ Streams an overkill, or maybe a misfit? In theory RabbitMQ Streams seem ...
0 votes
0 answers
56 views

How to identify an event stream?

I recently started discovering event sourcing so I am fairly new on the subject. Imagine having a system (system A) which listens to events of a third party order service (system B). These events can ...
  • 101
1 vote
2 answers
620 views

In CQRS/ES should database calls be done in command handlers or domain models?

In the context of a DDD application following CQRS and the event sourcing pattern, I have 2 questions. At which layer should the direct calls to the Infrastructure layer be made? At the Application ...
3 votes
0 answers
261 views

Implementation of projections in event-sourced system

I'm working on a application which uses event-sourcing and CQRS to define it's domain model. Background We have implemented projections to aggregate stream of all domain events into a read models used ...
  • 35.6k
0 votes
2 answers
164 views

How to build an event sourced system with AWS (Specifically, how to deal with side effects)

So the current setup is a typical event sourced system built on AWS: Lambdas exposed with API Gateway to get the orders (commands), the domain (aggregates) apply some validations after loading the ...
  • 101
1 vote
1 answer
252 views

In CQRS/ES where does an Aggregate Root belong?

Disclaimer: This question may be related to the framework I'm using to support CQRS/ES rather than the concepts themselves but many of these frameworks implement the same strategies, making me think ...
  • 111
0 votes
1 answer
325 views

How do I implement a domain entity behaviour that depends on some external infrastructure?

I am in the process of developing some software using CQRS, ES and DDD. A part of the system is writing services for controlling devices and collecting data from them. Consider a "Start" ...
  • 11
0 votes
3 answers
829 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, ...
  • 2,361
2 votes
1 answer
104 views

What is the relationship between Event Store and Persistence Mechanism when designing Aggregate + Event Sourcing?

I'm trying to implement an Event Store, to be used with Aggregate+Event Sourcing (A+ES), and I've run into I think a gap in understanding. I'm reading Implementing Domain Driven Design, using both the ...
  • 2,361
2 votes
2 answers
184 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 ...
  • 2,361
0 votes
2 answers
442 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 ...
5 votes
2 answers
858 views

In DDD Aggregate + Event Sourcing, do Events happen before or after state changes?

Part of the Aggregate + Event Sourcing (A+ES) methodology feels uncomfortable. Why does it feel uncomfortable? (As I've read from other questions and the book itself, it's a new-ish way of thinking, ...
  • 2,361
0 votes
2 answers
167 views

Event sourcing: Does it make sense for immutable entities?

I'm on a project which often follows the trends, so whatever works for big cool companies, will surely work for us, regardless the contexts and specifics. If that sounds like a little rant, then it is....
1 vote
1 answer
467 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 ...
  • 13
0 votes
1 answer
129 views

Event sourced persistence and data model refactoring

I've been working on a system that is using event-sourced persistence for it's data model. It is using a standard model of sequence of events with aggregates being rehydrated from those events and ...
  • 35.6k
2 votes
1 answer
433 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 ...
0 votes
2 answers
311 views

Event sourcing with concurrency against projections

I'm using event sourcing in an application and constantly find a problem for which I do not find a good solution. In this scenario we have an application for a hair stylist. We have a ...
  • 453
1 vote
0 answers
80 views

Strategy for a worker microservice to communicate with GraphQL API

I am trying to find the best way for a microservice to communicate with GraphQL Basic scenario: Client subscribed to GraphQL via Subscriptions (WebSockets) Client creates an Item using Mutation which ...
  • 111
0 votes
0 answers
238 views

How to save to database and publish atomically? ( all or none )

I'm trying to implement microservice architecture to our application (basically an ecommerce) and one of the challenges that I can't really find a good answer for (despite being so many similar ...
2 votes
1 answer
567 views

Communication between services in a microservices architecture, is direct communication okay?

I've been reading a lot on why one should use messages (w/ event sourcing/CQRS) for microservices communication and I get it. But most of the stuff I read online state that the main reason for using ...
1 vote
2 answers
586 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 ...
  • 111
-3 votes
1 answer
93 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; ...
  • 109
1 vote
1 answer
100 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-...
  • 143
3 votes
3 answers
2k 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 ...
  • 279
0 votes
1 answer
224 views

Event sourcing: Update local data before posting an event?

We are introducing events to our system (I would hesitate to call it 'event sourcing', but we have started down this road). To do this we are still maintaining the same HTTP public 'CRUD' API's, but ...
  • 165
2 votes
1 answer
195 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 ...
1 vote
1 answer
190 views

Options for building initial event sourcing projection when you cannot go back to the beginning of the history

I’m building a microservice which depends on a set of downstream services to collect the data necessary to operate. It is a data delivery system, I’m not source of truth for any data, my system rather ...
3 votes
3 answers
2k 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 ...
  • 502
1 vote
1 answer
289 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 ...
  • 111
-1 votes
2 answers
444 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 ...
  • 107
-2 votes
2 answers
69 views

Event Sourcing Architecture: Ingesting event data from Phones

We will be streaming data from Phones (<= 5000) to a server. We were previously sending the data using MQTT to AWS IOT. Now we want to run this locally. Estimated size per second to be ingested is ...
0 votes
3 answers
2k 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 ...

1
2 3 4 5 6