intermediateCRUD & Exposing Data

In a system fed by Kafka events, why do CRUD read endpoints usually query a local database rather than Kafka directly?

Kafka topics aren't optimized for ad-hoc queries (filter, sort, paginate) — they're an ordered log meant to be consumed sequentially. The standard pattern is a consumer that persists incoming events into a queryable local database (essentially a materialized view of the event stream), and REST read endpoints query that database, not the topic itself.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to Why might a write ('create') endpoint in an event-driven service publish to Kafka instead of writing directly to its own database?← Back to all Kafka & Microservices questions