# Service Discovery

Service discovery is the process of locating reachable instances of a service through a stable name or identifier rather than hard-coded network addresses.

Cloud concept. Updated 2026-11-15. Page: https://blowstack.com/tools/cloud-concepts-hub/service-discovery

> Service discovery maps a logical service name to connection information that changes as workloads scale, restart, move, or fail. It lets applications communicate without tracking individual instances, while requiring careful handling of registration, health, caching, and access boundaries.

Practice exams covering Service Discovery: [SAP-C03 AWS Certified Solutions Architect - Professional](https://blowstack.com/practice-exams/aws-certified-solutions-architect-professional).

## 6 key aspects of Service Discovery

Effective service discovery combines stable names, current endpoint information, health-aware lifecycle handling, and a resolution model that fits the application's security and operational requirements.

1. **Stable logical naming**: Callers address a service by a logical name instead of maintaining instance addresses. Define namespace boundaries so identical names in development, production, or different regions do not accidentally refer to the wrong workload.
2. **Dynamic endpoint registration**: A registry or platform tracks endpoint creation, replacement, and removal. Prefer lifecycle integration with the workload orchestrator, and account for abandoned registrations after crashes.
3. **DNS and API resolution**: DNS offers broad client compatibility, while discovery APIs can expose metadata and endpoint-selection filters. Check client support for record types, caching behavior, and refresh mechanisms before choosing an interface.
4. **Health and lifecycle awareness**: Discovery should reflect readiness and removal, not merely whether a process was started. Coordinate health checks, endpoint propagation, and connection draining to reduce requests to starting or terminating instances.
5. **Client and proxy integration**: Endpoint selection can happen in application libraries, local proxies, or shared intermediaries. Choose the placement based on client diversity, operational ownership, traffic-policy requirements, and acceptable forwarding overhead.
6. **Security and operational visibility**: Protect registration and lookup interfaces, and enforce traffic authorization separately from name resolution. Monitor discovery errors, endpoint counts, update delays, and connection failures so discovery problems can be separated from application failures.

## Cloud services for Service Discovery

These services implement different discovery and connectivity models and do not all need to be deployed together. AWS Cloud Map provides a registry with API and DNS discovery options. ECS Service Connect uses Cloud Map namespaces and managed proxies to simplify communication among participating ECS services. VPC Lattice offers a managed service-access layer with DNS names, routing, authorization, and telemetry across associated networks. Route 53 supplies DNS capabilities for broader naming requirements, including private namespaces used by Cloud Map. Select an approach according to the workload platform, client capabilities, network boundaries, and whether applications should receive backend endpoints or use a managed intermediary.

- **[AWS Cloud Map](https://blowstack.com/tools/cloud-services-hub/aws-cloud-map)**: AWS Cloud Map registers application resources in namespaces and supports discovery through APIs and, for supported namespace types, DNS. It can associate attributes and health information with instances so callers can locate suitable endpoints.
- **[Amazon Route 53](https://blowstack.com/tools/cloud-services-hub/amazon-route-53)**: Amazon Route 53 provides DNS resolution that can underpin service discovery, including private hosted zones for internal names. Endpoint-record updates require lifecycle automation or an integrating platform; DNS alone does not register workloads or guarantee application readiness.

## What is Service Discovery

Service discovery answers a practical question: where should an application send a request for a particular service right now? Instead of configuring an application with the IP addresses of individual payment servers, an engineer gives it a logical name such as payments.internal. A discovery mechanism resolves that name to instance addresses, a proxy listener, or a stable load-balancer endpoint. This separation becomes important when containers, virtual machines, and other workloads are routinely replaced.

A discovery system needs an authoritative representation of available services and their endpoints. Applications can register themselves, or an orchestrator can register and remove instances on their behalf. Registration may include an address, port, protocol, version, zone, and other metadata. DNS-based discovery exposes addresses through records such as A, AAAA, or SRV, while API-based discovery can return richer metadata and support explicit filtering. Clients must support the chosen mechanism; an ordinary hostname lookup does not automatically retrieve an SRV record's port information.

In client-side discovery, the application or its client library obtains endpoints and selects a destination. This avoids a separate forwarding hop but places endpoint selection, refresh behavior, and some failure handling in each client implementation. In server-side discovery, the client contacts a stable intermediary, such as a load balancer or proxy, which selects a backend. This centralizes routing behavior but introduces additional infrastructure, cost, and potentially latency. A sidecar proxy is another arrangement: applications use a local proxy while the proxy receives changing endpoint information from a control plane.

For example, an order service might call inventory.internal while an orchestrator scales the inventory service from three instances to twelve. New instances should become discoverable only when ready to serve requests. During termination, the platform should remove an instance from discovery and allow existing requests to drain before stopping it. Endpoint propagation, DNS caching, and connection reuse mean that removal is not instantaneous. A long-lived connection can continue using an old endpoint even after a DNS record expires.

Health-aware discovery reduces requests to unavailable instances, but registration alone does not prove application readiness. Health information may come from active probes, orchestrator readiness checks, heartbeats, or application-reported status. These mechanisms have different failure-detection delays and blind spots. Engineers should test process crashes, partial network failures, and failed dependencies, and determine whether stale endpoints remain usable when the discovery control plane is unavailable.

Service discovery is a foundation for service meshes, not a synonym for them. A mesh can distribute endpoint information to proxies and add traffic policies, authenticated communication, and request telemetry. Those capabilities are separate: finding a service does not authorize access, encrypt traffic, or generate distributed traces. Proxy metrics and access logs help distinguish resolution failures from connection failures and application errors; useful end-to-end tracing also depends on trace-context propagation.

Operational choices involve consistency, availability, and complexity. Short DNS lifetimes can reduce stale answers but increase lookup traffic, and actual refresh behavior depends on resolver and application caches. API watches can deliver endpoint changes promptly but require reconnect and resynchronization logic. Use bounded timeouts and carefully scoped retries, especially for non-idempotent requests. Across regions or administrative boundaries, define naming, identity, routing, and failover explicitly: a discoverable address is not necessarily reachable, authorized, or appropriate for every caller.
