Bird
0
0

To handle eventual consistency, which approach best ensures inventory updates reflect orders correctly despite delays?

hard📝 Trade-off Q15 of 15
Microservices - Event-Driven Architecture
You design a microservices system where orders and inventory are separate services. To handle eventual consistency, which approach best ensures inventory updates reflect orders correctly despite delays?
AStore orders and inventory in the same database to avoid syncing
BUse an event log where order service emits events and inventory service processes them asynchronously with retries
CMake inventory service call order service synchronously for every update
DIgnore inventory updates until orders are fully processed
Step-by-Step Solution
Solution:
  1. Step 1: Understand the need for asynchronous communication

    Orders and inventory are separate; syncing asynchronously avoids blocking and scales better.
  2. Step 2: Choose event log with retries for reliability

    Using an event log lets inventory process order events reliably, handling delays and retries to ensure consistency.
  3. Final Answer:

    Use an event log where order service emits events and inventory service processes them asynchronously with retries -> Option B
  4. Quick Check:

    Event log + async processing = robust eventual consistency [OK]
Quick Trick: Use event logs with retries for reliable async sync [OK]
Common Mistakes:
MISTAKES
  • Using synchronous calls causing blocking
  • Single database reduces microservices benefits
  • Ignoring updates causes stale inventory

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes