Patterns · Service Discovery
Patterns for services to find each other dynamically in environments where instance locations change constantly. These enable auto-scaling, rolling deployments, and health-based routing.
A database of available service instances and their network locations. Services register on startup and deregister on shutdown; clients query it to find instances.
Service instances register and deregister themselves with the service registry, sending periodic heartbeats to keep their registration alive.
A load balancer or router queries the service registry on the client's behalf, removing discovery complexity from clients entirely.