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
0 votes
1 answer
34 views

Is it a good/bad practice for a service to send events to itself via an external queue?

Imagine there is an Order entity that has a lot of states and conditional transitions between them. At the moment it is stored in a relational DB. There are multiple consumers of Orders that perform a ...
  • 307
0 votes
1 answer
37 views

How to handle related entities in an event sourced aggregate

I'm adventuring myself in the world of ES and CQRS and I've been reading a lot about it. Unfortunately, most materials don't go beyond the basics and when you start trying to apply it to real-world ...
  • 142
0 votes
0 answers
42 views

Dispatching different events in consistent order to event handlers in c++

The requirement is illustrated as follows: P-Thread1 -> Q1<EventType1> ==================== | <= P-Thread2 -> Q2<EventType2> ==================== | <= Poller Thread ...
  • 181
0 votes
1 answer
33 views

How to generate a status time duration matrix from Status event log?

I am trying to create a duration matrix, that is, time spent in each status based on the status transition event logs. I have the following event log where status transition time along with old and ...
  • 3
0 votes
1 answer
69 views

How is model reconstructed with event sourcing in CQRS principle?

I'm trying to understand the CQRS design. As far as I know now, every time a change to a model is saved, the (state) change is stored as a separate record. When reading a model, the model is ...
0 votes
0 answers
44 views

Event sourcing authentication remeber_me token best practices

I have a system that uses event sourcing. https://laravel.com/docs/5.8/authentication#remembering-users I'm trying to replicate the functions of the basic Laravel authentication. However with event ...
2 votes
3 answers
283 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
294 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
52 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
123 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 ...
1 vote
1 answer
196 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 ...
  • 213
-1 votes
1 answer
140 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
71 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
192 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
124 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
1 answer
115 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
149 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
2 answers
166 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
185 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
270 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
180 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
135 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
261 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
72 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
847 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
315 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.9k
0 votes
2 answers
183 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
344 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
459 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
1k 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,383
2 votes
1 answer
137 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,383
2 votes
2 answers
325 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,383
0 votes
2 answers
571 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
1k 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,383
0 votes
2 answers
183 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....
2 votes
1 answer
600 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 ...
  • 23
0 votes
1 answer
170 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.9k
2 votes
1 answer
614 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
347 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
95 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
324 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
649 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 ...
2 votes
2 answers
718 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 ...
  • 121
-3 votes
1 answer
96 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
115 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
271 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
216 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
239 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
3k 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
2 3 4 5 6