Home

ServiceDiscovery

Service discovery is a mechanism in distributed systems to enable components to locate one another's network locations. It addresses the dynamic nature of modern architectures where service instances may scale up or down, move, or fail. Central to service discovery are service registries, which maintain records for available service instances and their network addresses, metadata, and health status. Clients or routers query the registry to obtain current endpoints.

There are two broad patterns: client-side discovery and server-side discovery. In client-side discovery, a service instance

Mechanisms for implementation include DNS-based discovery, HTTP-based registries, and specialized systems. DNS service discovery uses DNS

Service discovery is often combined with service registration, health monitoring, and sometimes service mesh technologies that

Challenges include consistency, latency, and partition tolerance in dynamic environments, as well as securing service endpoints

queries
the
registry
directly
to
obtain
a
list
of
healthy
instances
and
selects
one
to
call,
often
with
client-side
load
balancing.
In
server-side
discovery,
a
load
balancer
or
reverse
proxy
queries
the
registry
and
routes
requests
to
instances,
shielding
clients
from
endpoint
details.
SRV
or
A/AAAA
records
to
resolve
service
instances.
Registry
systems
include
Consul,
Etcd,
Zookeeper,
and
cloud-native
options
such
as
Kubernetes
service
discovery
(via
CoreDNS
or
kube-dns).
Health
checks
and
heartbeats
keep
the
registry
up
to
date.
handle
discovery,
load
balancing,
and
security
policies
across
microservices.
and
preventing
stale
routing
information.