In a microservice architecture, each service owns its data and controls access to it. This keeps service boundaries clear, but it makes cross-service queries harder. When an application needs information held by several services, it must either make multiple calls and combine the results or maintain a view shaped for that use case.
This is the role of a data projection: a representation of data prepared for a particular read scenario and stored where that scenario can use it. The design questions are practical ones: who owns the source data, how are changes delivered, and how do we detect a projection that has fallen behind?
Consider account data. Three services need it, each with its own database:
an account-details service displays information about an account;
a customer-summary service calculates aggregates across a customer’s accounts;
a product-recommendation service uses account data to recommend products.
A fourth service is the master service for accounts.…