Answer with the actual reasons from your project — interviewers want to see that the decision was deliberate, not fashionable. Typical reasons that justify CQRS over a standard controller, service, repository and database structure: 1. Read and write requirements were very different - Writes involved complex business rules (pricing, availability, approval workflows) best expressed in a rich domain model. - Reads needed fast, flexible queries across many entities — search with filters and facets, dashboards, aggregated views — that were awkward and slow when built through the same domain model and repositories. 2. Read volume far exceeded writes - For example, travel search and listing pages received 50–100 times more traffic than bookings. Separate read models (denormalised tables, Redis or a search index) allowed scaling and caching reads independently without risking the transactional write path. 3. Performance of complex queries - Building screens from normalised tables required many joins and aggregations on every request. Precomputed read models updated from events made those queries simple and predictable. 4. Event-driven integration was already needed - The system already published domain events (BookingConfirmed) for notifications, billing and analytics. Using the same events to update read models was a natural extension. 5. Clearer code ownership and maintainability - Command handlers captured business intent and validation in one place; query handlers became thin projections. This reduced the bloated services and repositories that had grown in the layered design, and made testing easier. 6. Auditability or event sourcing requirements (if applicable) - Commands and events gave a clear history of changes for compliance. How to present it, with honesty about trade-offs "We chose CQRS for the booking domain because searches and dashboards needed denormalised, fast read models while bookings needed strict business rules and transactions. Read traffic was about 80 times write traffic. We kept one SQL database for writes, used Dapper projections for most queries, and fed an Elasticsearch index from booking events for search. We accepted eventual consistency of a few seconds on search results, handled in the UI. For simple admin CRUD screens we did not use CQRS — they stayed with a standard controller, service and repository structure." This shows you understand both why CQRS was valuable and where a traditional approach was the better choice.
Ravindra Wadile · · 0 likes