Service Discovery

Service discovery deals with the problem of mapping services to IPs: If a load balancer wants to send a request to an API server, how does it figure out which ip address to sent it to? This AWS whitepaper gives a high level overview and trade-offs to a couple of approaches:

Domains Names and Load Balancers

Alias service domain names (using CNAME records) to the load balancer, which routes to the correct service based on path or host name. This is vulnerable to DNS caching, but you can mitigate that with a short TTL.

DNS

You can also use DNS to route requests directly to the service. Route 53 allows you to restrict access to services in your own virtual private cloud.

Configuration management

Map service names to IP addresses in your configuration, which you can set on server start. In particular, you can have new service register with a central configuration manager like AWS OpsWorks.

This is also the basis for frameworks like Netflix Eurkea or Consul.