Just wondering, is anyone doing this for real? (Even if not Route53, but DNS in general)
Would it work? I can see how this would be really fast, and really cheap (although possibly writes could have a small delay). Using a private DNS zone, it would be “private” too, up to a certain limit.
Holy crap my nonsense got traction. Please don’t take it as a good idea; most of my architectures are intentionally awful for amusement purposes.
It can be done, but it’s invariably a poor idea. Some things overwrite DNS TTL, DNS library implementation details vary wildly, and it’s just not the best tool for the job.
You should use tags on various resources in your AWS account as your primary database instead.
Well, thanks for the “authoritative” response (pun intended ). I know you wrote that for amusement, but often there’s some genius in the madness
I thought it would have deserved some more discussion at the very least.
Some things overwrite DNS TTL
I’m not sure I follow you here. Respecting the TTL is a client-dependent choice. If I used my own DNS client (and it’s really not hard, see for example this in Go) then I could decide to ignore the TTL. I would obviously need to request the record directly from the authoritative DNS server (Route53 in this case).
DNS library implementation details vary wildly
Agree, but that’s why you’d need to use your own DNS library and stick to that.
it’s just not the best tool for the job
I don’t disagree, but this is precisely why I wanted to discuss this further
After writing this post I realized that, for example, Active Directory does use DNS as a key-value store in certain situations. So maybe it’s not that much of a terrible idea!
I would obviously need to request the record directly from the authoritative DNS server (Route53 in this case).
Right, anything that stood between you and the authoritative server (in some cases transparently!) might rewrite TTL to save their network bandwidth, as some operators think it’s still 1995 and DNS traffic is significant. Clients that aren’t carefully coded may also hit the system cache if one’s running; ASK ME HOW I KNOW.
It can be done, but it’s almost gorgeous in its horror. DNS is also notoriously unreliable, so using configuration management to manage /etc/hosts across your fleet is of course the preferred strategy there. Thanks, Ansible!
Real world story: I have a production system for the Last Week in AWS newsletter. The issue number increments once a week and is used in a few different places. I toyed with stuffing that in DynamoDB with some other things, Route 53… but ultimately settled on an object in S3. I am no-joke giving a talk about this system next month at ServerlessConf in NYC.
I guess what I’m really saying here is that S3 makes a fantastic DNS service in a pinch.
And I never knew the value of a properly setup and maintained DNS infrastructure where I didn’t have to question if I screwed up or the DNS was screwed up, until well, I was doing that weekly. I may be having flashbacks.
DNS CERT records are used for this type of purpose (although in a niche / narrow capacity). I’ve seen them used in combination with PKI for things like the Direct Project Protocol (a system for implementing secure email for medical applications).
eMule was using dns as key-value store back 15 years ago
there was an A record storing the latest version like:
latest.something.tld A 1.3.0.1
when an update got released the record was bumped to
latest.something.tld A 1.3.0.2
and at startup the binary first checked if latest version was matching current, if it wasn’t it would notify you about existing update.
Back at that time eMule had the biggest distributed key-value store (kademlia: it had most AZ then any other cloud out there… 10000+ “AZ” were part of it) to make use of… but still they preferred the DNS method
You should use tags on various resources in your AWS account as your primary database instead.
I like how this flew under the radar. Personally i think IAM policies are a good candidate, as compared to e.g. ec2 instances. They’re cheap and can be tied to groups/users/roles. There’s lots of opportunity there for hierarchical structuring of your key/value db.
Honestly, why do we bother using Redis when such a valuable resource is already available to us just a cURL call away