What Is a Query Handler?
A query handler is code that receives a query describing what data is wanted and returns it, performing no writes. It often reads from a denormalized read model tuned for fast retrieval rather than from the write model. Separating it from command handlers lets reads and writes scale and evolve on their own.
Why it matters
Keeping reads side-effect free makes them easy to cache, replicate, and optimize. It cleanly separates the data shape users see from the model used to enforce business rules.
Related guides
What Is a Command Handler?A command handler is the component that receives a command requesting a change, validates it, and executes th…
What Is a Read Model?A read model is a data representation optimized for queries and display, often denormalized and kept separate…
What Is CQRS?CQRS separates the model used to change data from the model used to read it, letting writes and reads be desi…