.NET Architecture & System Design Interview Question #89

What is a projection in an event-sourced system?

Transactions, CQRS, Event Sourcing & Distributed Consistency Mid-Level Intermediate

Quick Interview Answer

A projection transforms events into a model optimized for a particular read or reporting requirement. Multiple projections can be built from the same event stream.

Detailed Explanation

A projection transforms events into a model optimized for a particular read or reporting requirement. Multiple projections can be built from the same event stream.

Because projections are derived data, they can often be rebuilt by replaying events. Designers must handle projection failures, checkpoints, duplicate events, ordering, and schema evolution.

Code Example

Event Stream
   |------> OrderSummary Projection
   |------> SalesReport Projection
   |------> Search Projection