4 ms·
A lot of people are confused about why something like this is necessary, and IMO it really comes down to one thing: sometimes the stuff you want to talk to move
by ninkendo 10y ago
A lot of people are confused about why something like this is necessary, and IMO it really comes down to one thing: sometimes the stuff you want to talk to moves around.
As soon as you're not allowed to rely on the service you talk to saying on the a static set of machines (and even on a static set of ports) over time, using standard HTTP libraries becomes really awkward. (Did this request fail because an instance shut down and I should talk to another one? How do I convince my DNS resolving library to ignore its cache and re-lookup the service? Ok I found 3 instances, which one should I talk to? How do we prevent all the other copies of me from spamming the same instance? Gee, it'd be really nice to have something push a notification to me when the services change!)
Not-so coincidentally, this constraint is really common in "cloud native" setups like Kubernetes and Mesos, where service instances come and go as part of normal operation. This is because, in this world you don't update your code by copying new files to some servers and SIGHUP'ing some daemon, you update your code by deploying new containers, waiting for them to be healthy, and tearing down the old ones. This means "failure" is a normal part of your normal software lifecycle.
Linkerd is one of many attempts to make "normal software" behave well in this world, without relying on too much intelligence in the HTTP client libraries (or other non-HTTP stuff, for that matter.)
In a perfect world, everything would respect and obey DNS SRV records. Oh if only most client software knew what they were, and how to handle them! Right there you can see which backends are available for a service, what ports they're on, what their priorities are, and how long that information should be considered valid. But alas, nothing really supports SRV records. So we need something like this until client software becomes more intelligent (if ever.)
- jmspring 10y agoEven if they did, the issue w/ caching DNS info will possibly still bit one. Java apps is one specific example that comes to mind.
- koolba 10y agoI suppose you could get around that with custom DNS server. Something like xip.io but resolving to the parent and allowing the prefix as a cache buster. Ex: foo.some-delim.baz.bam.example.com would resolve to baz.bam.example.com regardless of the foo prefix. The client could then iterate or randomly generate values for foo to ensure fresh DNS lookups.
- thinkMOAR 10y agoI'm only confused why i had to click so many times to find the piece i needed to read what linkerd actually does or is. I should have read your post at first..