Bird
0
0

Which design best ensures accurate status reporting without causing delays?

hard📝 Trade-off Q8 of 15
Microservices - Resilience Patterns
You need to implement a comprehensive health check for a microservice that depends on a database, a cache, and an external API. Which design best ensures accurate status reporting without causing delays?
ACheck dependencies sequentially and return the first failure immediately.
BPerform parallel asynchronous checks for all dependencies and aggregate results with timeouts.
COnly check the microservice's own status and ignore dependencies to keep it fast.
DRun health checks once daily and cache the result for all requests.
Step-by-Step Solution
Solution:
  1. Step 1: Understand requirements

    The health check must verify multiple dependencies accurately without delays.
  2. Step 2: Evaluate options

    Perform parallel asynchronous checks for all dependencies and aggregate results with timeouts. uses parallel asynchronous checks with timeouts, minimizing latency and providing comprehensive status.
  3. Step 3: Identify drawbacks of other options

    Check dependencies sequentially and return the first failure immediately. is slower due to sequential checks; Only check the microservice's own status and ignore dependencies to keep it fast. ignores dependencies; Run health checks once daily and cache the result for all requests. is outdated and may mislead.
  4. Final Answer:

    Perform parallel asynchronous checks for all dependencies and aggregate results with timeouts. -> Option B
  5. Quick Check:

    Parallel async checks reduce latency and improve accuracy [OK]
Quick Trick: Use parallel async checks with timeouts [OK]
Common Mistakes:
MISTAKES
  • Checking dependencies sequentially causing slow responses
  • Ignoring dependencies in health checks
  • Caching health results too long causing stale info

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes