What is a service registry and give examples?

Answer

A service registry is a database that stores the network locations (host, port, metadata) of all running service instances. Services register themselves when they start and deregister when they stop. Other services query the registry to discover where to send requests. It is the phone book of a microservices system. Popular service registries include: Consul (by HashiCorp, supports health checking, KV store, and DNS-based discovery), Eureka (by Netflix, Java-based, REST API), and etcd (distributed key-value store used by Kubernetes internally). In Kubernetes, the Service resource and CoreDNS provide built-in service discovery without needing a separate registry.