0
0
HLDsystem_design~12 mins

Health check endpoints in HLD - Architecture Diagram

Choose your learning style9 modes available
System Overview - Health check endpoints

This system provides health check endpoints to monitor the status of various components in a distributed application. It ensures that services, databases, and caches are operational and responsive, allowing automated systems to detect failures quickly and trigger alerts or recovery actions.

Architecture Diagram
          +------------+
          |   Client   |
          +-----+------+ 
                |
                v
       +--------+---------+
       |   Load Balancer  |
       +--------+---------+
                |
                v
       +--------+---------+
       |  API Gateway     |
       +--------+---------+
                |
       +--------+---------+-------------------+
       |                  |                   |
       v                  v                   v
+------+-----+     +------+-----+       +-----+------+
| Health     |     | Service A  |       | Service B  |
| Check      |     +------------+       +------------+
| Endpoint   |           |                    |
+------------+           |                    |
                         v                    v
                  +------+-----+        +-----+------+
                  | Database   |        | Cache      |
                  +------------+        +------------+
Components
Client
user
Sends health check requests to monitor system status
Load Balancer
load_balancer
Distributes incoming requests evenly across API Gateway instances
API Gateway
api_gateway
Routes health check requests to the health check endpoint or services
Health Check Endpoint
service
Responds to health check requests with status of system components
Service A
service
Main application service that depends on database and cache
Service B
service
Secondary service that uses cache for faster responses
Database
database
Stores persistent application data
Cache
cache
Stores frequently accessed data for quick retrieval
Request Flow - 8 Hops
ClientLoad Balancer
Load BalancerAPI Gateway
API GatewayHealth Check Endpoint
Health Check EndpointDatabase
Health Check EndpointCache
Health Check EndpointAPI Gateway
API GatewayLoad Balancer
Load BalancerClient
Failure Scenario
Component Fails:Database
Impact:Health check endpoint reports database as unhealthy; services depending on database may fail writes or reads
Mitigation:Use database replication for failover; health check alerts trigger automated recovery or manual intervention
Architecture Quiz - 3 Questions
Test your understanding
Which component first receives the health check request from the client?
AHealth Check Endpoint
BLoad Balancer
CAPI Gateway
DDatabase
Design Principle
This architecture uses a dedicated health check endpoint accessed through a load balancer and API gateway to monitor the health of critical components like database and cache. It ensures quick detection of failures and supports automated recovery, improving system reliability.