Skip to content
Yves Reynhout edited this page Aug 4, 2016 · 3 revisions

Introduction

A common question that arises is how to deal with messages arriving out of order at a projection and/or how to make a projection resilient against that phenomenon.

Reasons

But why would messages arrive out of order to begin with? One reason is picking a push based delivery mechanism (e.g. certain queuing technology) that can not guarantee that messages are delivered in the order they were written or published in. Another reason is weak ordering guarantees by the message producers, regardless of the delivery mechanism in use. To elaborate, assuming the messages are actually business events produced by an eventsourced aggregate (cfr. Domain Driven Design), then the weak ordering may manifest itself when the projection is consuming events across aggregates (regardless of the type of aggregate). Why? Aggregates are by their very nature strong consistency boundaries - but each one individually, not across aggregates.

Projection Design

There is, however, another side to this. Whether or not out of order messages are a problem depends on the delivery mechanism and how the projection handling is designed.

Clone this wiki locally