Bird
0
0

How can you design a Kafka-based CQRS system to handle high read traffic without slowing down writes?

hard📝 Application Q15 of 15
Kafka - Event-Driven Architecture
How can you design a Kafka-based CQRS system to handle high read traffic without slowing down writes?
AUse only one consumer group for both commands and events
BCombine commands and events in one topic to reduce overhead
CWrite all data directly to the database and skip Kafka for reads
DUse separate Kafka topics for commands and events, and scale read consumers independently
Step-by-Step Solution
Solution:
  1. Step 1: Apply CQRS scalability principle

    Separating commands and events allows independent scaling of write and read sides.
  2. Step 2: Design Kafka topics and consumers

    Using separate topics for commands and events lets read consumers scale without affecting write performance.
  3. Final Answer:

    Use separate Kafka topics for commands and events, and scale read consumers independently -> Option D
  4. Quick Check:

    Separate topics and scale reads independently [OK]
Quick Trick: Separate topics and scale read consumers for high traffic [OK]
Common Mistakes:
MISTAKES
  • Combining commands and events causing bottlenecks
  • Skipping Kafka for reads losing scalability
  • Using one consumer group for all messages

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes