eventhorizon icon indicating copy to clipboard operation
eventhorizon copied to clipboard

[projection] Projections are not durable

Open maxekman opened this issue 7 years ago • 6 comments

Imagine your projection is down and several commands reach to the command side and result into some events persisted into event store. Once the projection is up again, new events will not be collected.

maxekman avatar Oct 25 '16 19:10 maxekman

@dtravin FYI, added this as an issue from our mail conversation.

maxekman avatar Oct 25 '16 19:10 maxekman

When a projection goes down it should either know the position of the last event in the stream.

Or should just clear any previous state that was made by projection and run it again then mark it self as ready before accepting requests etc.

bweston92 avatar Feb 27 '18 14:02 bweston92

@maxekman @bweston92 Is it applicable even if projections and event store are part of same microservice? would like to understand, even if both are part of same microservice, is it possible that only projector gets down? or it it the case when mogodb projections and event store are in different mongo cluster? Also as I understand, writing the event to event store and projections is atomic operation.

nmkarvekar avatar Jun 10 '19 12:06 nmkarvekar

Writing to an event store and projections is and should never be atomic.

You ideally would have a write service and a query service that way you can scale each independently. You can then also have many different queryable outputs from the events.

bweston92 avatar Jun 10 '19 12:06 bweston92

thanks @bweston92 . Would like to know the use case when only particular projections gets down? Is it possible even if they are part of same microservice?

nmkarvekar avatar Jun 11 '19 04:06 nmkarvekar

Yes, if the underlying storage is not responding for example. Remember that the projections could use a different storage than the event store, and as @bweston92 noted there could even be multiple projections for the same event stream (MongoDB and BigQuery could be one such example).

maxekman avatar Jun 11 '19 05:06 maxekman