DEV Community

Discussion on: Explain Service Discovery like I'm five

Collapse
 
johsim_ profile image
Johanna Simonsson

Thank you for your reply! So, have I understood it correctly that when people say "Don't use DNS for Service Discovery", it's because of DNS cannot really determine if a service is dead? The domain name might be cached even though the service is gone?

Collapse
 
egidijus profile image
Egidijus

To over-simplify - yes, DNS by design will resolve to IP addresses even if those IP addresses have not been used for 90 years. (assuming that the DNS servers are still there).

DNS in hashi consul is a matter of convenience, and also does routing to services that are available, or in a particular data-center.

If you like to live dangerously, you could implement very primitive service discovery with DNSmasq, but you should not.

DNS itself is not a bad or a good thing, it depends what you use it for, and the tolerances of caching, stale data, failures that your systems will put up with.