Chaturmind
LearnDSASystem DesignDevOpsEngineering GrowthBlog
Start learning
Chaturmind

Structured learning paths for engineers who want to go deep. Written by practitioners.

Learn

  • Java
  • DSA
  • System Design
  • Spring Boot
  • AI / ML
  • DevOps
  • Engineering Growth

Company

  • Blog
  • Contact

Legal

  • Privacy Policy
  • Terms of Service

© 2026 Chaturmind. All rights reserved.

Built for engineers who want to go deep.


← Low-Level Design & Design Patterns

OOP Fundamentals & SOLID Principles

  • Object-Oriented Design Refresher
  • Single Responsibility & Open/Closed
  • Liskov Substitution & Interface Segregation
  • Dependency Inversion

Creational Design Patterns

  • Singleton Pattern
  • Factory & Abstract Factory
  • Builder Pattern
  • Prototype Pattern

Structural Design Patterns

  • Adapter & Facade
  • Decorator Pattern
  • Composite & Proxy
  • Bridge & Flyweight

Behavioral Design Patterns

  • Strategy Pattern
  • Observer Pattern
  • Command Pattern
  • Template Method
  • State Pattern
  • Chain of Responsibility
  • Iterator & Mediator
  • Visitor Pattern

Machine Coding Exercises

  • Parking Lot — Requirements & Class Design
  • Parking Lot — Implementation
  • Elevator System — Requirements & Class Design
  • Elevator System — Implementation & Scheduling
  • Library Management System
  • Tic-Tac-Toe / Board Game Design
  • Chess Engine Design
  • Vending Machine Design
  • ATM System Design
  • In-Memory Rate Limiter
  • Thread-Safe LRU Cache
  • Connection Pool Design
  • Producer-Consumer Class Design
  • Movie Ticket Booking System
  • Hotel Reservation System
  • Airline Booking / Seat Selection System
  • Splitwise / Expense Sharing System
  • Design a Logging Framework
  • Design a Notification/Observer-Based Pub-Sub
  • Design a Cache with Pluggable Eviction Policy
  • Design Snake and Ladder
  • Design a Card Game Framework
  • Design an Inventory Management System
  • Restaurant Management System
  • Food Delivery Order Matching
  • Design a Shopping Cart & Checkout Flow
  • Design a Recommendation Engine
  • Design a Job Scheduler
  • Design a Circuit Breaker
  • Design a Distributed ID Generator
  • Design a Pub-Sub Message Broker
  • Design Twitter/X
  • Multi-Pattern Problem: Design a Ride Booking Class Model
  • Multi-Pattern Problem: Design a Food Ordering Class Model
  • Design an Authentication/Authorization Module
  • Design a Form/Survey Builder
  • Design a Meeting Room / Calendar Booking System
  • Design a Search/Filter Engine for an E-Commerce Catalog
  • Design a Voting/Polling System
  • Design a Retry Mechanism with Backoff
  • Design a Health Check Aggregator
  • Design a Feature Flag System
  • Design a Config Management Client
  • Design a Leader Election Algorithm
  • Design a Distributed Counter
  • Design a Bloom Filter
  • Design a Consistent Hashing Ring
  • Design a Distributed Tracing Library
  • Design a Metrics Collection Library
  • Design an Audit Logging Framework
  • Design a Plugin/Extension System
  • Design a Workflow Engine
  • Multi-Pattern Capstone: Design a Food Delivery App
Chaturmind
← Low-Level Design & Design Patterns

OOP Fundamentals & SOLID Principles

  • Object-Oriented Design Refresher
  • Single Responsibility & Open/Closed
  • Liskov Substitution & Interface Segregation
  • Dependency Inversion

Creational Design Patterns

  • Singleton Pattern
  • Factory & Abstract Factory
  • Builder Pattern
  • Prototype Pattern

Structural Design Patterns

  • Adapter & Facade
  • Decorator Pattern
  • Composite & Proxy
  • Bridge & Flyweight

Behavioral Design Patterns

  • Strategy Pattern
  • Observer Pattern
  • Command Pattern
  • Template Method
  • State Pattern
  • Chain of Responsibility
  • Iterator & Mediator
  • Visitor Pattern

Machine Coding Exercises

  • Parking Lot — Requirements & Class Design
  • Parking Lot — Implementation
  • Elevator System — Requirements & Class Design
  • Elevator System — Implementation & Scheduling
  • Library Management System
  • Tic-Tac-Toe / Board Game Design
  • Chess Engine Design
  • Vending Machine Design
  • ATM System Design
  • In-Memory Rate Limiter
  • Thread-Safe LRU Cache
  • Connection Pool Design
  • Producer-Consumer Class Design
  • Movie Ticket Booking System
  • Hotel Reservation System
  • Airline Booking / Seat Selection System
  • Splitwise / Expense Sharing System
  • Design a Logging Framework
  • Design a Notification/Observer-Based Pub-Sub
  • Design a Cache with Pluggable Eviction Policy
  • Design Snake and Ladder
  • Design a Card Game Framework
  • Design an Inventory Management System
  • Restaurant Management System
  • Food Delivery Order Matching
  • Design a Shopping Cart & Checkout Flow
  • Design a Recommendation Engine
  • Design a Job Scheduler
  • Design a Circuit Breaker
  • Design a Distributed ID Generator
  • Design a Pub-Sub Message Broker
  • Design Twitter/X
  • Multi-Pattern Problem: Design a Ride Booking Class Model
  • Multi-Pattern Problem: Design a Food Ordering Class Model
  • Design an Authentication/Authorization Module
  • Design a Form/Survey Builder
  • Design a Meeting Room / Calendar Booking System
  • Design a Search/Filter Engine for an E-Commerce Catalog
  • Design a Voting/Polling System
  • Design a Retry Mechanism with Backoff
  • Design a Health Check Aggregator
  • Design a Feature Flag System
  • Design a Config Management Client
  • Design a Leader Election Algorithm
  • Design a Distributed Counter
  • Design a Bloom Filter
  • Design a Consistent Hashing Ring
  • Design a Distributed Tracing Library
  • Design a Metrics Collection Library
  • Design an Audit Logging Framework
  • Design a Plugin/Extension System
  • Design a Workflow Engine
  • Multi-Pattern Capstone: Design a Food Delivery App
HomeLearnSystem DesignLow-Level Design & Design PatternsMachine Coding Exercises
✓ FreeIntermediate· 6 min read

Design a Health Check Aggregator

HealthCheck, HealthCheckRegistry, and aggregation logic for combining multiple dependency checks into one overall status, mapped directly onto Spring Boot Actuator's own HealthIndicator design.

Published September 23, 2026


Design a Health Check Aggregator

Core classes

interface HealthCheck { HealthStatus check(); String name(); }
enum HealthStatus { UP, DOWN, DEGRADED }

class HealthCheckRegistry {
    List<HealthCheck> checks = new CopyOnWriteArrayList<>();
    void register(HealthCheck check) { checks.add(check); }
}

HealthCheck as an interface (not a fixed enum of known checks) is what makes the registry OPEN for new dependency checks without ever modifying the registry itself — adding a check for a new dependency (a message broker connection, an external API) is purely additive, the same Open/Closed pattern seen throughout this Machine Coding chapter.

Aggregating multiple checks into one overall status

class HealthAggregator {
    HealthStatus aggregate(List<HealthCheck> checks) {
        List<HealthStatus> results = checks.stream().map(HealthCheck::check).toList();
        if (results.stream().anyMatch(s -> s == HealthStatus.DOWN)) return HealthStatus.DOWN;
        if (results.stream().anyMatch(s -> s == HealthStatus.DEGRADED)) return HealthStatus.DEGRADED;
        return HealthStatus.UP;
    }
}

The aggregation LOGIC itself is a real design decision, not a trivial detail: should ANY single DOWN dependency make the WHOLE service report DOWN, or only checks marked as "essential"? This directly mirrors Health Checks' essential-vs-non-essential distinction — a more sophisticated version would tag each HealthCheck with a criticality level, and only ESSENTIAL checks failing should drag the overall status to DOWN, while non-essential checks failing might only produce DEGRADED (still serving traffic, with reduced functionality).

Mapping directly onto Spring Boot Actuator's HealthIndicator

// Actuator's actual interface — structurally identical to the HealthCheck above
interface HealthIndicator { Health health(); }

This exercise's HealthCheck/HealthCheckRegistry/aggregation design ISN'T a hypothetical toy — it's essentially a from-scratch reimplementation of what Spring Boot Actuator already provides via HealthIndicator (covered concretely in Health Checks). Building it yourself here is what makes Actuator's own design legible — recognizing the SAME Open/Closed extension point, the SAME aggregation-across-multiple-checks pattern, in a framework you already use daily.

Follow-up questions this topic invites — and their answers

Q: How would you add per-check timeout handling, so one slow HealthCheck doesn't block the whole aggregation? A: Wrap each individual check's execution with a timeout (Timeout Strategy) — running checks in parallel (each with its own bounded timeout) rather than sequentially, treating a check that times out as DOWN (or DEGRADED) rather than letting it stall the entire aggregation indefinitely.

Q: Should the aggregator cache results rather than re-running every check on every request? A: Often yes, for exactly the reason discussed in Health Checks' follow-up questions — running an expensive check (a real database query) on every single health-check poll adds avoidable load; caching results for a short interval and only re-running periodically is a common, practical optimization.

Q: How does 'criticality level' per check actually get decided? A: This is a genuine per-dependency design decision, not something derivable automatically — it requires explicitly reasoning about each dependency's role (per Health Checks' essential-vs-non-essential framing), and different services legitimately reach different answers for what looks like a superficially similar dependency.

Q: Does this design need to distinguish liveness-check aggregation from readiness-check aggregation? A: Yes — mirroring Health Checks' liveness/readiness split, a real implementation would maintain TWO separate check sets/aggregations (a minimal liveness set with no external dependencies, a broader readiness set including real dependency checks), not one single aggregated status serving both purposes.

Previous

Design a Retry Mechanism with Backoff

Next

Design a Feature Flag System

AI Tutor

Lesson: Design a Health Check Aggregator

Quick actions

AI responses can be inaccurate. Verify critical information.