2013-03-24

Fast IP Geo Location

IP Geo location is process to locate the geographic area from the IP address.

For example website bourgas.org is Bulgarian website, but if you check the IP address, you will find it is hosted in Huston, TX, USA.

Another example is - user come to your website, the system checks where is he/she from and display page for USA, Canada, Europe or World.

Your system can even reject the access, if visitor comes from "forbidden" countries or states, say all Delaware visitors get message "Sorry, but due to legal reasons, we can not deal with you".

There are lots of paid resources that enable IP Geo location, but most used one is Maxmind GeoIP database.

The best "property" of this database is that there is very good *FREE* version.

This free version works much better than paid versions of most other Maxmind's competitors.

Also you get not only country to IP, but also IP to city database for free.

The biggest problem of those IP Geo databases are that they are slow. If you want to process huge amount of data, soon or later the speed will not meet your requirements.

This is why many people import this information in relational databases, such MySQL for example.
But if you do so, then your MySQL or whatever will slow down too.

Here we developed a solution that uses Redis as storage engine:
https://github.com/nmmmnu/GeoIP-Redis

Because everything fits in memory, the speed is as fast as possible it can be. This allows you to process more data, for less time and with less hardware, effectively saving money and maximizing profits :)