0
0
Microservicessystem_design~12 mins

Liveness and readiness probes in Microservices - Architecture Diagram

Choose your learning style9 modes available
System Overview - Liveness and readiness probes

This system uses liveness and readiness probes to monitor microservices health. Liveness probes check if a service is alive and should be restarted if not. Readiness probes check if a service is ready to accept traffic, ensuring smooth user experience.

Architecture Diagram
User
  |
  v
Load Balancer
  |
  v
API Gateway
  |
  v
+------------------+      +------------------+
| Microservice A    |<---->| Liveness Probe   |
| (with Readiness)  |      +------------------+
+------------------+
        |
        v
+------------------+
| Database         |
+------------------+
Components
User
client
Sends requests to the system
Load Balancer
load_balancer
Distributes incoming requests to API Gateway instances
API Gateway
api_gateway
Routes requests to microservices and performs health checks
Microservice A
service
Handles business logic; has liveness and readiness probes
Liveness Probe
health_check
Checks if Microservice A is alive; triggers restart if failed
Readiness Probe
health_check
Checks if Microservice A is ready to serve traffic
Database
database
Stores persistent data used by Microservice A
Request Flow - 9 Hops
UserLoad Balancer
Load BalancerAPI Gateway
API GatewayReadiness Probe
API GatewayMicroservice A
Microservice ADatabase
Microservice AAPI Gateway
API GatewayLoad Balancer
Load BalancerUser
Liveness ProbeMicroservice A
Failure Scenario
Component Fails:Microservice A
Impact:If Microservice A crashes, liveness probe detects failure and triggers restart. Readiness probe marks service as not ready, so no traffic is sent to it.
Mitigation:Orchestrator restarts Microservice A automatically. Load balancer and API Gateway stop sending traffic until readiness probe reports ready.
Architecture Quiz - 3 Questions
Test your understanding
Which probe ensures the service is ready to accept user traffic?
ALiveness probe
BReadiness probe
CLoad balancer health check
DDatabase connectivity check
Design Principle
Using liveness and readiness probes separates concerns of service health and traffic readiness. This improves system reliability by restarting unhealthy services and preventing traffic to services not ready to serve, ensuring smooth user experience.