← Back to microservices patterns map
🔍
Microservices Pattern

Service Discovery

Services register and discover dynamic endpoints instead of hardcoding hostnames or IPs.

discovery

Detailed Description

In containerized systems, service instances appear and disappear constantly. Discovery makes this normal.

Kubernetes DNS handles a lot of this automatically, while service registries offer richer metadata and health awareness.

Visual Diagram

Service starts -> registry
Client asks registry
Registry returns healthy endpoints

Tradeoffs

Pros

Dynamic scaling, no hardcoded config

Cons

Registry becomes critical infrastructure

Examples: Consul, Kubernetes DNS, Eureka