Bird
0
0

How can you ensure eventual consistency between command and query sides in a Kafka CQRS system?

hard📝 Application Q9 of 15
Kafka - Event-Driven Architecture
How can you ensure eventual consistency between command and query sides in a Kafka CQRS system?
ABy merging command and query logic into a single service
BBy making query handlers wait synchronously for command processing to finish
CBy using Kafka topics to asynchronously propagate events from command to query handlers
DBy disabling Kafka partitions to ensure order
Step-by-Step Solution
Solution:
  1. Step 1: Understand eventual consistency in CQRS

    Command side updates state and emits events; query side updates read models asynchronously.
  2. Step 2: Use Kafka for asynchronous event propagation

    Kafka topics deliver events to query handlers, enabling eventual consistency without blocking commands.
  3. Final Answer:

    By using Kafka topics to asynchronously propagate events from command to query handlers -> Option C
  4. Quick Check:

    Kafka async events enable eventual consistency [OK]
Quick Trick: Use Kafka events to sync command and query sides asynchronously [OK]
Common Mistakes:
MISTAKES
  • Trying synchronous waits in query handlers
  • Merging command and query logic
  • Disabling Kafka partitions incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes