3 ms·
This is one of the applications for which I really like small couch dbs. Build it in one place, replicate all over. I converted something from that to a couch
by dlsspy 15y ago
This is one of the applications for which I really like small couch dbs. Build it in one place, replicate all over.
I converted something from that to a couchdb in a couple of minutes and set up a view to reproduce their CIDR export data. For example:
http://dustinphoto.couchone.com/country_ip/_design/views/_view/by_code?group=true http://dustinphoto.couchone.com/country_ip/_design/views/_vi...
Pull a single country, bogons (XA) in this case. It looks slightly funny since I used the CIDR address as the key since I can extrapolate pretty much everything else from it:
http://dustinphoto.couchone.com/country_ip/_design/views/_view/by_code?reduce=false&key=%22XA%22 http://dustinphoto.couchone.com/country_ip/_design/views/_vi...
This model means I can rate limit to near nothing without affecting people because they can just replicate http://dustinphoto.couchone.com/country_ip/ http://dustinphoto.couchone.com/country_ip/ and use their own infrastructure while keeping the data fully synchronized.
I've got another similar database where I integer encoded the keys so they sort numerically so a reverse limit 1 sorted search by integer key will return lat/long data at whatever granularity that particular block was captured (could be a single IP address). I should get these consolidated somehow.