Bird
0
0

Consider a microservice with a Sidecar that handles logging. If the main service crashes, what happens to the Sidecar?

medium📝 Conceptual Q13 of 15
Microservices - Advanced Patterns
Consider a microservice with a Sidecar that handles logging. If the main service crashes, what happens to the Sidecar?
AThe Sidecar also stops because it shares the same lifecycle
BThe Sidecar continues running independently
CThe Sidecar restarts the main service automatically
DThe Sidecar switches to a backup service
Step-by-Step Solution
Solution:
  1. Step 1: Understand Sidecar lifecycle dependency

    The Sidecar runs in the same environment and shares lifecycle with the main service, so if the main service stops, the Sidecar usually stops too.
  2. Step 2: Evaluate other options

    Sidecar does not run independently, restart the main service, or switch to backup automatically.
  3. Final Answer:

    The Sidecar also stops because it shares the same lifecycle -> Option A
  4. Quick Check:

    Sidecar lifecycle tied to main service = D [OK]
Quick Trick: Sidecar shares lifecycle with main service, stops if service crashes [OK]
Common Mistakes:
  • Thinking Sidecar runs independently after crash
  • Assuming Sidecar restarts main service
  • Believing Sidecar switches to backup automatically

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes