Service Discovery
Service discovery lets services dynamically register and look up each other's addresses, fitting cloud-native environments where instances come and go.
Purpose
Dynamically manage service instance addresses, adapting to elastic scaling.
Mechanism
Registration: instances register their address with a registry on startup. Discovery: callers fetch the instance list from the registry. Client-side load balancing picks an instance. Implemented by Consul/Eureka/K8s DNS.
Use cases
- Microservice communication
- Dynamic scaling
- Cloud native