Bird
0
0

You need to create a live dashboard displaying the total number of transactions per account using Kafka Streams interactive queries. Which design approach is most suitable?

hard📝 Application Q8 of 15
Kafka - Advanced Stream Processing

You need to create a live dashboard displaying the total number of transactions per account using Kafka Streams interactive queries. Which design approach is most suitable?

AUse Kafka Streams to write counts to a topic and read from it directly in the dashboard
BMaintain a state store with counts per account and query it via REST endpoints
CStore counts in an external database and update it asynchronously from Kafka Streams
DUse Kafka Streams to process transactions but do not maintain any state store
Step-by-Step Solution
Solution:
  1. Step 1: Maintain counts in a state store

    Kafka Streams can keep real-time counts per account in a local state store.
  2. Step 2: Expose counts via interactive queries

    The dashboard can query this state store through REST endpoints backed by Kafka Streams interactive queries.
  3. Step 3: Avoid indirect or delayed methods

    Writing counts to a topic or external DB adds latency and complexity.
  4. Final Answer:

    Maintain a state store with counts per account and query it via REST endpoints -> Option B
  5. Quick Check:

    Interactive queries enable direct state store access [OK]
Quick Trick: Use state stores with REST for real-time dashboards [OK]
Common Mistakes:
MISTAKES
  • Relying solely on topics for querying counts
  • Using external DBs causing stale data
  • Not maintaining state stores for aggregation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes