Pick the fix
Search and dashboards need very different views of orders than checkout does, and complex joins are slowing checkout. Which approach is CQRS?
Hint 1 of 1
Separate the shapes for reading and writing.
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A Keep writes in PostgreSQL and project changes into a search index and summary tables for reads
Correct. Separate read models built from the write side's changes.
CQRS splits the model you write to from the models you read from. Checkout writes stay normalised in PostgreSQL, and search and dashboards read projections fed by those changes.
Why not the others?
- B Add more indexes to the orders table. Helps reads but loads the write path more.
- C Put everything in one big denormalized table. That merges the models instead of separating them.
- D Cache every query result for an hour. Caching isn't a separate model and can serve hour-old data.