What is a service registry in microservices?

A Service Registry is a directory that keeps track of every running instance of every microservice and its network location so other services can find and call it.

Key Points

Example

When a new instance of an Inventory service starts, it registers itself with Eureka; the API Gateway then asks Eureka for a healthy Inventory instance instead of pointing at a fixed IP address, so the gateway keeps working even as instances scale up or down.

// Registry server (spring-cloud-starter-netflix-eureka-server)
@SpringBootApplication
@EnableEurekaServer
public class RegistryApplication {
    public static void main(String[] args) {
        SpringApplication.run(RegistryApplication.class, args);
    }
}

# Each service (spring-cloud-starter-netflix-eureka-client), application.yml
spring:
  application:
    name: inventory-service          # the name other services look up
eureka:
  client:
    service-url:
      defaultZone: http://registry:8761/eureka/
  instance:
    prefer-ip-address: true

Interview Tip

A concise interview answer is

A Service Registry is a live directory of service instances and their locations, updated through registration and heartbeats. It lets clients or load balancers discover healthy instances dynamically instead of relying on hardcoded addresses, which is essential once instances scale up and down.

Last updated: 11 November 2026

Previous question: What are some of the risks involved with inter-service communication?

Next question: How does service discovery work in microservices?

More Microservices - Level I interview questions

All Microservices - Level I questions