-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We need to update the code for the newer Amazon module. #14
Comments
With the newer interface we can change the way we work significantly:
We explicitly don't need to download all the existing/current values. (The current behaviour is: Download all the DNS names & values. If they differ delete the old record by name. Then add the new record. If they're the same do nothing.) The /home page currently lists all known-names for a user, along with the current DNS values. There are two ways to go:
Assuming a user has one name they will have at most two DNS lookups ( For the single-case it is clearly a net-win to perform two DNS lookups rather than fetching 1000+ entries from the zone, via the Amazon API. For the case where somebody has five names? The case become less clear. Although caching will happen with the Amazon API lookup that will need to be flushed every time any user makes a change. Which means in practice the cache is good for 1-3 minutes at the most. Running a DNS lookup will also involve caching, subject to the TTL, on the local node. Conclusion:
|
This commit updates #14, by changing the way we lookup the current value(s) of the given names. Rather than fetching the live data from the Amazon API we lookup via DNS. If a user is registered and has `foo.dhcp.io` we do a lookup of the name `foo.dhcp.io`, and rely on the caching present in the local resolver. This is more efficient than fetching the contents of the complete `dhcp.io` zone, then parsing each record to see if it matches `foo`. TODO: * Update the API we bundle, such that we can use `upsert`. Upsert allows us to send a message which says: * Set foo.dhcp.io (A) -> 1.2.3.4 Rather than having to : * Download the zone. * Find the current value. * Delete the value, explicitly. * Add the value with the new IP. The whole thing we're trying to avoid is having to download the zone, because internally the Amazon API allows you to only do that in stages: * Download the first 50 records. * Download the next 50 records. * Download the next 50 records. * Are we done? If not download the next records. * etc.
sigh
The text was updated successfully, but these errors were encountered: