

What do you use for service discovery? - blooberr

There&#x27;s a ton of choices out there - etcd, zookeeper, and more.<p>What are some of the pitfalls I should be aware of?<p>Should I keep things simple and roll my own using Redis backed by sentinel&#x2F;clustering?
======
tatalegma
Can someone give a really brief description of what service discovery is, and
when/why one would need it?

What's wrong with simply having a config file that tells your code the URL for
each service it depends on (assuming my understanding of what discovery is is
valid)?

~~~
hkarthik
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.

