47 votes
Accepted

What is the difference between Event Driven and Event sourcing?

The term Event driven architecture is used for any kind of software system which is based on components communicating mainly or exclusively through events. For example, almost any major GUI framework ...
Doc Brown's user avatar
  • 203k
28 votes
Accepted

Why Protobuf 3 made all fields on the messages optional?

proto3 makes a number of changes aimed (as I understand it) at making it far more usable in cross-platform scenarios. Explicit tracking of "assigned" vs "not assigned but reporting the default value" ...
Marc Gravell's user avatar
  • 2,837
26 votes
Accepted

ES / CQRS concurrency handling

I sketched my rough understanding on how an ES / CQRS app should look like contextualized to a simplified banking use case (withdrawing money). This is the perfect example of an event sourced ...
Constantin Galbenu's user avatar
21 votes
Accepted

Event sourcing, replaying and versioning

First, it is important to understand and be able to leverage the difference between Commands and Events. As this question succinctly points out, Commands are things we would like to happen, and ...
theMayer's user avatar
  • 648
21 votes
Accepted

Which comes first: event or the change?

Reminder: it is not your fault that you are confused; the literature sucks. Which of these two approaches is truly Event Sourcing? "Event sourcing", as spoken by Event Store, Eventide project, and ...
VoiceOfUnreason's user avatar
19 votes
Accepted

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

Since you tagged your question with "CQRS", I guess you mean events in a "CQRS & Event Sourcing" context, like it is described here. In this tutorial, the difference between ...
Doc Brown's user avatar
  • 203k
18 votes
Accepted

How to implement a process manager in event sourcing

Review what Rinat Abdullin wrote about evolving business process. In particular, notice his recommendation for developing a business process in a fast changing environment -- a process manager is "...
VoiceOfUnreason's user avatar
17 votes
Accepted

CQRS and DDD terminology

CQRS and DDD are separate/orthogonal concepts, and I think you divided the terms pretty close to right. Events under DDD are called Domain Events, and are somewhat different from the Messaging events ...
Kasey Speakman's user avatar
16 votes

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

What I'm not super clear on is why you would ever rehydrate your Aggregates from the Event Store itself. Because the "events" are the book of record. If projecting changes to "read" databases is ...
VoiceOfUnreason's user avatar
15 votes

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

In retrospect, I think I was complicating the issue. In general, commands should either throw an exception or raise one or more events. If I could summarise the architecture of Event Sourcing it ...
magnus's user avatar
  • 674
14 votes
Accepted

How do I deal with side effects in Event Sourcing?

How do I deal with side effects in Event Sourcing? Short version: the domain model doesn't perform side effects. It tracks them. Side effects are performed using a port that connects to the ...
VoiceOfUnreason's user avatar
12 votes

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

In my experience, most questions about transactionability and microservices are caused by the following two reasons: The transactional data is placed in different microservices: This is wrong by ...
Francesc Castells's user avatar
12 votes
Accepted

"event sourcing" vs. "event logging" architecture pattern?

Event Sourcing means that you build the current state of an object from a history of events. Event Logging just means you log the events. In order to make Event Sourcing work, you have to do a few ...
Ewan's user avatar
  • 72.4k
11 votes

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

One command can raise multiple events. It is simply logical conclusion of one fact : Composite command exists. Lets say you have two commands, each raising an event. Then, you create a composite ...
Euphoric's user avatar
  • 37k
11 votes

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

Usually one command will lead to one event. But in some cases it can also be more than one, it depends on your implementation. Either your command calls other commands and each of them fire own ...
synthomat's user avatar
  • 256
11 votes

DDD, CQRS, ES - is it worth it or it just waste of time?

Well they are three separate things and they are real things not just buzz words. But.... Domain Driven Design. I've seen this used quiet commonly now, at least in a 'lite' fashion. I think it does ...
Ewan's user avatar
  • 72.4k
11 votes

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

My guess is that you need to explore more carefully an approach that you have rejected Enqueue the events on our server My suggestion would be to start reading through the various articles published ...
VoiceOfUnreason's user avatar
9 votes
Accepted

CQRS-Event Sourcing: how to process events in the expected order inside the read model

The infrastructure for the event sourcing is an event store which saves the events as documents inside a MongoDB collection and then publish a corresponding message to a service bus, so that with a ...
VoiceOfUnreason's user avatar
9 votes
Accepted

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

Input stream It is not clear if your 1000 events/second represent peaks or if it's a continuous load: if it's a peak, you could use a message queue as buffer to spread the load on the DB server over ...
Christophe's user avatar
  • 75.9k
8 votes
Accepted

CQRS/ES in haskell, using "Out of the tar pit" paper architecture

With the CQRS/ES in mind, I have a decision engine. The decision engine for producing an event from a command, is the Business Domain, which has to be purely functional. Good. When a command asks ...
VoiceOfUnreason's user avatar
8 votes

DDD, CQRS, ES - is it worth it or it just waste of time?

Sometimes the most important principles in software engineering are K.I.S.S and Y.A.G.N.I. All software engineering principles, guidelines, methodologies are merely suggestions which exist to steer ...
Ben Cottrell's user avatar
  • 11.7k
8 votes

What is a good diagrammatic way to represent async event communication between two systems?

The UML sequence diagram is well adapted to represent an interaction between several objects (or components or, why not,systems). It has semantic to make the difference between synchronous and ...
Christophe's user avatar
  • 75.9k
8 votes
Accepted

CQRS, How to query aggregate root using others fields rather than GUID (ID)?

CQRS/ES is a tricky architecture in many aspects and you've found one of them. First of all, since you're storing events it is very hard to query an entity based on its data since you don't actually ...
Pedro Goes's user avatar
8 votes
Accepted

Why "Event sourcing an entire system is a big mistake and considered an anti-pattern"?

Event Sourcing is hard and doesn't achieve a great deal on its own. Also, People confuse Event Sourcing with a whole tonne of other things and find that they haven't achieved what they expected at ...
Ewan's user avatar
  • 72.4k
7 votes

Event sourcing, one event, state of two aggregates changed

When transferring it's different - two aggregates must be modified by one MoneyTransferred event. Transferring money is a separate act from updating the ledgers. MoneyTransferred AccountCredited ...
VoiceOfUnreason's user avatar
7 votes
Accepted

Handling aggregate root with deep object hierarchy

If you want to do it the right way as DDD suggests, then you are only allowed to change shape colour by using a method on the aggregate root directly and you cannot do it on the shape directly. The ...
Andy's user avatar
  • 10.3k
7 votes
Accepted

Reducing the code duplication between read and write application in CQRS

It's pretty natural to have some duplication between the Command side and Query side, starting with knowing the same essential Events and payload structures. While standard structures might still be ...
Subhash's user avatar
  • 1,561
7 votes
Accepted

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

Short answer: You should generate two events. A single command invocation can lead to multiple events, so generating more of them really isn't an issue. But why exactly would you want to do that in ...
Andy's user avatar
  • 10.3k
6 votes
Accepted

Database design, processor vs inconsistency

It depends on what you're willing to do in terms of architectural/performance payoffs. It sounds like at the core you're doing a kind of Event Sourcing, which actually makes a lot of sense when you ...
Darien's user avatar
  • 3,463
6 votes
Accepted

Is event sourcing only for when writes are rare?

So, what am I missing? Taking a guess. The first thing that you may be missing is that you only need to reload the events for the state you are rebuilding. If you can model your transaction ...
VoiceOfUnreason's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible