.NET Architecture & System Design Interview Question #144

What is the difference between liveness and readiness checks?

Resilience, Rate Limiting, Health Checks & Observability Senior Advanced

Quick Interview Answer

A liveness check asks whether the process is alive enough that restarting it could help. A readiness check asks whether the instance is currently able to receive traffic.

Detailed Explanation

A liveness check asks whether the process is alive enough that restarting it could help. A readiness check asks whether the instance is currently able to receive traffic.

An application can be alive but not ready, for example during startup or when a required dependency is unavailable. Conflating the two can cause unnecessary restart loops.

Code Example

Liveness:
Should this process be restarted?

Readiness:
Should traffic be routed here now?