Problem Statement
When a service or server fails silently or becomes unresponsive, the system cannot detect the failure quickly. This leads to prolonged downtime, poor user experience, and difficulty in automated recovery or scaling decisions.
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│ Client / │ │ Load │ │ Service │
│ Monitoring │──────▶│ Balancer │──────▶│ Instance │
│ System │ │ │ │ │
│ (Health │ │ │ │ ┌─────────┐ │
│ Checker) │ │ │ │ │Health │ │
└───────────────┘ └───────────────┘ │ │Check │ │
│ │Endpoint │ │
│ └─────────┘ │
└───────────────┘This diagram shows a monitoring system or load balancer querying the health check endpoint of a service instance to verify its status before routing traffic.
/ready to indicate if the service is ready to accept traffic./ready is the standard path for readiness checks.if database.isConnected() and cache.isAvailable():
return 200
else:
return 503def health_check():
if db.connected() or cache.available():
return 200
else:
return 503/health endpoint for liveness and a /ready endpoint for readiness. Which of the following best describes when the /ready endpoint should return HTTP 503?Pass the test and this pattern moves unknown