Read models optimize queries by copying data into a view suited to access patterns. Their freshness depends on delivery and processing lag.
Before you start
You should understand HTTP, database transactions and the difference between one process and independently failing services. Draw the participants and message direction before choosing a pattern. Include timeout, duplicate delivery and recovery in the model instead of considering only successful requests.
The practical goal is to reason through this situation: A dashboard combines order and shipment projections without synchronous joins on every request. Read the walkthrough first, then try the interview exercise before opening its answer. The important part is explaining the decision and its consequences, rather than remembering a definition alone.
Step-by-step walkthrough
Step 1: Choose query needs
Shape the projection around the dashboard’s access pattern.
Step 2: Measure lag
Track processed position and freshness rather than treating replication as instant.
Step 3: Escalate critical decisions
Use authoritative checks when stale data could violate correctness.
Worked scenario
A dashboard combines order and shipment projections without synchronous joins on every request.
A dashboard shows a shipment as pending just after dispatch because its projection is behind. That may be acceptable with freshness information. Cancelling based on that stale status could be unsafe, so the command owner must check authoritative shipment state before accepting cancellation.
Common mistake
Presenting a stale projection as strongly current can mislead operational decisions.
Verify the behavior
Delay projection processing and test both display behavior and critical commands.
Interview exercise
Expose freshness usefully.
Answer and reasoning
Track projection progress and provide a direct authoritative check for decisions whose correctness cannot tolerate lag.
Continue learning
Compare the scenario with the Microservices interview questions and test your understanding with the Microservices MCQs. For terminology and implementation details, consult the reference material.