Bird
0
0

You design a microservice system where Service A calls Service B, which calls Service C. To avoid cascading delays, you want to apply the timeout pattern effectively. Which strategy is best?

hard📝 Trade-off Q15 of 15
Microservices - Resilience Patterns
You design a microservice system where Service A calls Service B, which calls Service C. To avoid cascading delays, you want to apply the timeout pattern effectively. Which strategy is best?
ASet equal timeout values on all calls regardless of call chain
BSet a single long timeout only on Service A's call to B, ignoring B to C timeouts
CDo not use timeouts; rely on retries to handle delays
DSet a timeout on Service A's call to B, and also on B's call to C, each shorter than the caller's timeout
Step-by-Step Solution
Solution:
  1. Step 1: Understand cascading call delays

    Service A calls B, which calls C. If B waits too long for C, A's timeout may be exceeded.
  2. Step 2: Apply timeout pattern to prevent cascading delays

    Each service should have a timeout shorter than its caller's timeout to fail fast and avoid long waits.
  3. Final Answer:

    Set a timeout on Service A's call to B, and also on B's call to C, each shorter than the caller's timeout -> Option D
  4. Quick Check:

    Timeouts cascade with decreasing limits [OK]
Quick Trick: Timeouts should cascade with shorter limits downstream [OK]
Common Mistakes:
MISTAKES
  • Setting only one timeout ignoring nested calls
  • Using equal timeouts causing delays
  • Relying only on retries without timeouts

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes