Bird
0
0

You need to design a Kafka topic structure to separate messages by region and product category. How should topics be organized?

hard📝 Application Q8 of 15
Kafka - Topics and Partitions
You need to design a Kafka topic structure to separate messages by region and product category. How should topics be organized?
AUse one topic for all messages and filter by region in consumers
BCreate separate topics for each region and product category combination
CStore all messages in one topic partitioned by timestamp
DCreate topics only by product category, ignoring region
Step-by-Step Solution
Solution:
  1. Step 1: Analyze message separation needs

    Separating by region and product category requires distinct topics for each combination.
  2. Step 2: Evaluate options

    Create separate topics for each region and product category combination creates clear separation. Use one topic for all messages and filter by region in consumers mixes messages making filtering harder. Store all messages in one topic partitioned by timestamp partitions by time, not needed here. Create topics only by product category, ignoring region ignores region separation.
  3. Final Answer:

    Create separate topics for each region and product category combination -> Option B
  4. Quick Check:

    Separate topics by region and category = Create separate topics for each region and product category combination [OK]
Quick Trick: Use separate topics for distinct message groups [OK]
Common Mistakes:
  • Using one topic and filtering later
  • Ignoring one dimension of separation
  • Partitioning by irrelevant fields

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes