1
votes

We've got a CQRS project and are thinking about a way to implement a "catchup", e.g. a new event handler is started and tells the eventstore to replay all events for him.

We're not sure if we should do the replay over the NServiceBus, as there is a real 1:1 connection and no publish/subscribe situation. Also we think that our new consumer is not able to keep up with the publish-speed and its input queue would get stuck.

What's the best practice here?

1
Can you add some more detail? I'm a bit lost as to exactly what the question is.Adam Fyles
In short: CQRS -> new read model installed -> event handler for the read model needs to receive all events from the beginning in order to fill the read model -> best practice to retrieve them all from the event store :-)D.R.
Is each read model a replica?Adam Fyles

1 Answers

0
votes

I've heard of people doing the following:

  1. Have a system of replaying/rebroadcasting the events. Event handlers that have produced projections that have already seen these events ignore the events.
  2. Allow events to be queried directly by the Event Handler when resetting it or when starting a new projection from scratch. This can be done in some systems by reading directly from the event store and in other actor based system an actor abstraction around the source of events may be queried.

From my understanding, option 2 allows for better performance as events can be queried in batches as opposed to being replayed to all listeners individually. These are just my observations without any practical experience to draw on yet.