DNS Key Value Storage
dnskv.com
dnskv.com
It sounded ugly on-paper, but the design was approved by everyone in the chain of command for what I presume was for lack of other viable options given the architecture.
And in ironic turn of events, instead of using DNS for service discovery, another set of engineers in the team opted for EC2 metadata (for example, security groups) instead.
To be honest I'm not sure if it's a total hack or a reasonable use as intended, or somewhere in between. But it got it done, and is at least more elegant than hard coding something arbitrary which may change (just not too frequently), I think.
DNS is also usually a much better option than the framework-specific service discovery mechanism that every framework seems to be destined to reinvent. I think the problem is that most computer scientists aren't very well-versed in networking, and DNS doesn't look like the best match at first glance.
There is a current fad of HTTP+JSON as a generic protocol substrate, but it's almost always a mediocre fit for the problem at hand. Go read the RFC archives, there's diamonds to be found.
On the other hand, and perhaps even by the same token: using EC2 metadata isn't a completely terrible idea if it's the infrastructure you already have and the semantics line up with specific needs.
[0] https://debathena.mit.edu/trac/wiki/Hesiod [1] http://www.mit.edu/afs.new/athena/project/ctraining/presenta...
It's nice to have a dedicated and restricted resolver config so that the zone visibility can be restricted but that makes deployment a little more complex.
The seamless integration of all the Project Athena stuff (Hesiod, Kerberos, etc.) with DEC Ultrix is one of many reasons that Ultrix is still, IMO, the greatest Unix/;Unix-like distro in history.
[0] https://twitter.com/quinnypig/status/1120653859561459712
Source: Principal at AWS, worked on route 53 for a few years.
sounds like another good candidate for distributed TimeSeries DB or DHT type of things.
Want to check if Tom has access to /web/mike? Just do a lookup on the user in question with the reversed path you want to check.
"Can Tom read /web/mike?" => tom.mike.web.server.net
Advantages:
- Replication to multiple machines is trivial (piggybacking of DNS, after all).
- Lookups are fast. Can also be easily cached.
- All sane programming languages have built-in DNS resolution in their stdlib out-of-the-box.
- Manual override using /etc/hosts for debugging/emergency.
You wouldn't use this to determine if the user really is who he says he is. But in determining what a user has access to, DNS is pretty slick. The DNS server doesn't need to be public either.
A, AAAA, TXT - set record
A, AAAA - check key
TXT - read value
Dynamic DNS supports all of these options directly. Why are additional records used for the key and value? IXFR could instead be used to check if a record is up-to-date rather than overloading A and AAAA in their meaning?I’m probably missing something about how these records are meant to be used together. Is there a protocol doc available?
Insert:
· value.key.
So if you $ dig txt value.key.dnskv.com
you will receive an "ok" if setting key=value succeeded. Then if you $ dig txt key.dnskv.com
you will get the answer "value".Read more of the page to find out what else you can do.
dig txt u[update-secret].value.key.dnskv.com # set for first time
dig txt u[update-secret].new-value.key.dnskv.com # use the same update secret, noone can now use this key without it until expiry
also helps to add dig @ns.dnskv.com. txt ...
to prevent caching or what it's called in DNSinsert with any type of query to value.key.dnskv.com
check if key is set with A or AAAA query to key.dnskv.com
read value of key with TXT query to key.dnskv.com
;; ANSWER SECTION:
pressbutton.dnskv.com. 604740 IN TXT "nannal"
I played around with something similar on my domain, using DoH to fetch txt values for page modification . dig TXT nannal.com|grep status
Plan was to grab that, pipe it into a JS switch statement and then change some CSS values based on the value.If you don't delete the record, the key will always have the same id-number, so you never need more than a single API call to reference a value or change it.
The data for the RR was a series of key=value pairs.
IIRC it would look something like this in a zone file...
foo TYPE "foo=bar" "baz=qux"