I have a Rails 4 app deployed on Heroku.
I have a method that decode an ip
number to it´s city
equivalent.
From what I've understood there are a bunch of pitfalls when geocoding, i.e. reaching request limit on shared ip, unupdated geocode providers etc.
If someone has any recent experience of any similar user case as the one described above, it would be much appreciated to learn what setup works (if at all) best.
Two key things you can do easily and should be more than sufficient are:
Use
geokit
'sMultiGeocoder
andip_provider_order
to define which geocoders to fall back on when a failure occurs.Cache results. There's currently a pull request in
geokit
that adds an inbuilt caching option but writing your own cache is easy plus you could make it smarter. E.g. if an IP is similar to another IP e.g first three parts are same it's probably the same location.Harder options might be to have the entire ip database in your app thus not needing to make any requests at all.