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.

Event-sourcing is an architectural pattern that manages the current state as the result of a sequence of events that are captured and stored. Each of these events triggers a state change.

See also

262 questions
29
votes
1 answer

Why Protobuf 3 made all fields on the messages optional?

The syntax 3 of protobuf made all the fields optional dropping the keywords required and optional from previous proto2 syntax. Reading some comments from developers it seems that it was done for enhancing forward/backward binary compatibility. But…
tonicebrian
  • 413
  • 1
  • 4
  • 6
28
votes
3 answers

Which comes first: event or the change?

I've been researching Event Sourcing, and it seems there are two philosophies hidden within what I've read. The core difference is whether actors in the system are proactive, making changes first and publishing events based on what they have done,…
TheRubberDuck
  • 933
  • 6
  • 13
28
votes
1 answer

What is the difference between Event Driven and Event sourcing?

I'm studying domain driven design (DDD) and came across terms: Event Driven and Event sourcing. I know it's about publishing event from producer to consumer, and store the log, so my question is: What is the difference between Event Driven and Event…
J.J. Beam
  • 461
  • 1
  • 4
  • 7
25
votes
2 answers

ES / CQRS concurrency handling

I recently started to dive into CQRS / ES because I might need to apply it at work. It seems very promising in our case, as it would solve a lot of problems. I sketched my rough understanding on how an ES / CQRS app should look like contextualized…
Louis F.
  • 353
  • 3
  • 6
23
votes
3 answers

When using DDD and CRQS, should be exactly one event per command?

I am looking for a way to design a ddd application with convention over configuration. Say an aggregate "Client" has a command defined "FillProfile". It will logically raise an event "ProfileFilled". Are there cases when a command will raise more…
Ludovic C
  • 603
  • 5
  • 9
20
votes
2 answers

How to implement a process manager in event sourcing

I'm working on a small example application to learn the concepts of CQRS and event sourcing. I have a Basket aggregate and a Product aggregate which should work independently. Here's some pseudo code to show the implementation Basket { BasketId;…
Ivan Pintar
  • 1,177
  • 1
  • 8
  • 15
20
votes
5 answers

DDD, Saga & Event-sourcing: Can a Compensate Action simply be a delete on the event store?

I realize the above question probably raises a few 'what??'s, but let me try to explain : I'm trying to wrap my head on a couple of related concepts, basically the Saga-pattern ( http://www.rgoarchitects.com/Files/SOAPatterns/Saga.pdf) in…
Geert-Jan
  • 673
  • 1
  • 5
  • 13
19
votes
2 answers

Event sourcing and REST

I came across Event Sourcing design and I would like to use in an application where a REST client is needed (RESTful to be precise). However I fail to connect these together as REST is quite CRUD-like and event sourcing is task based. I was…
redhead
  • 581
  • 6
  • 15
16
votes
3 answers

In CQRS/ES, can a command create another command?

In CQRS/ES, a command is sent from the client to the server and routed to the appropriate command handler. That command handler loads an aggregate from its repository, and calls some method on it, and saves it back to the repository. Events are…
magnus
  • 664
  • 1
  • 5
  • 14
16
votes
3 answers

Are Domain Objects in Domain Driven Design only supposed to be write-only?

I've been reading about Domain Driven Design for almost two years and have been cautiously been introducing some concepts in to my daily work or at least making plans for how things I do regularly could be done within a Domain Driven Design. One…
15
votes
3 answers

Rehydrating Aggregates from a "snapshots" projection rather than the Event Store

So I've been flirting with Event Sourcing and CQRS for a while now, though I've never had the opportunity to apply the patterns on a real project. I understand the benefits of separating your read and write concerns, and I appreciate how Event…
MetaFight
  • 11,549
  • 3
  • 44
  • 75
15
votes
2 answers

How do I deal with side effects in Event Sourcing?

Let's assume that we want to implement a small security subsystem for a financial application that warns the users via email if a strange pattern is detected. For this example, the pattern will consist in three transactions as the ones depicted. The…
Jacob
  • 321
  • 2
  • 7
14
votes
7 answers

Saving high-frequency events to a connection-limit constrained database

We've got a situation where I have to deal with a massive influx of events coming in to our server, at about 1000 events per second, on average (peak could be ~2000). The problem Our system is hosted on Heroku and uses a relatively expensive Heroku…
nicholaswmin
  • 1,869
  • 2
  • 18
  • 36
13
votes
4 answers

Event sourcing and persistence

I'm reading up on event sourcing and have a question regarding persistence. I can still have a DB with all entities, right? Or should the events be replayed every time the application is started to get the latest version of each entity in the…
jgauffin
  • 4,512
  • 21
  • 33
12
votes
4 answers

How to handle transactional operations in an event-driven architecture?

I'm trying to flesh out an eCommerce system using microservices (.NET Core and Kubernetes), event sourcing (Kafka), and CQRS. The particular use case I've been thinking about is as follows. There is an inventory microservice designed to use CQRS. …
1
2 3
17 18