Hacker News new | ask | show | jobs
by hkarthik 4280 days ago
Once you start thinking about immutable infrastructure and auto-scaling, service discovery becomes very important.

Let's say you have a load balancer with 4 web servers behind it, each with its own IP.

If you hit a traffic spike, you'd like your system to automatically provision another web server and add it to the load balancer with no manual intervention.

With a Service Discovery server, your load balancer could be polling the server for a list of nodes it needs to add or remove from its pool. It could also send a signal to the service discovery server that will indicate that it's dealing with a higher traffic threshold. This signal can then be captured by another Provisioning service (also polling Service Discovery) which then triggers the building of a new web server. The web server could then signal to the load balancer to add it to the pool.

Without a system like this, a person has to go in and manually update the configs on all the relevant servers. The idea behind service discovery is to prevent that.