0

Say each microservice is using event sourcing which means it has it's own event store, do you typically add another "mother" event store that contains all events from all microservices as a source of truth on how each system communicated?

E.g.,

enter image description here

2 Answers 2

1

Say each microservice is using event sourcing which means it has it's own event store, do you typically add another "mother" event store that contains all events from all microservices as a source of truth on how each system communicated?

No, but sort of.

Typically, separate micro-services means that any given stream has a single logical authority that "owns" the responsibility for maintaining the stream invariant. Common practice (to simplify management) is to arrange your streams so that all streams owned by the same service are shared together in a single logical event store.

You can, of course, have multiple microservice sharing the same physical event store(s).

Where things get interesting: writes are targeted to a single stream, but reads are very often interested in events that may be written to many streams -- or more precisely to copies of events written to many streams.

Assuming you are comfortable with some latency, it doesn't particularly matter that the readers aren't connected to "the" authoritative copy of the stream, as long as the information that they do get is internally consistent (ie, a true snapshot of the stream at some point in the not-necessarily-immediate past).

So yes, you could add a mother store, decoupling most of the read traffic from the stores that are managing the writes (in much the same way that you might have RDBMS replicas supporting queries).

I wouldn't call it "typical" though - especially given that the replica (in your micro service example) is being created from multiple different stores.

0

It depends why you want to cobain it. Services should be separate domain contexts so it doesn't make sense to keep them together as they don't provide additional value together. Although it is quite common to use a broker (e.g. Apache Kafka) to distribute events and allow flexible distribution to your service's event stores as well as durability and reliability.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.