event-sourcing

How should projectionists run in an event sourced system?


I have been reading on event sourcing for a while. The information regarding how to actually build projections seems... scattered.

From what I gathered, we have a projectionist, which manages projectors, which build and update projections.

How should a system run a projectionist? Should it be one process, which handles all projectors? Or should it run one projectionist per projection, independent from each other?


Solution

  • It depends.

    A central projectionist handling all projections can work well initially. But if some views take longer to update than others, it can become a bottleneck.

    Running a separate projectionist per view allows each model to process events independently. If one is slow or fails, the others can continue without disruption. This also makes it easier to introduce new models that can catch up in the background and lets you rebuild individual read models as needed.