About

Sypex Geo is a product for determining location by IP address, from the creators of Sypex Dumper. Having received the IP address, Sypex Geo provides information about the visitor’s location - country, region, city, geographic coordinates.

Sypex Geo - distributed under the BSD license, i.e. i.e. is absolutely free.

As a database, Sypex Geo uses a binary file of its own format. This format is open and universal. When developing the format, a lot of work was done to optimize the algorithm. Thanks to this, Sypex Geo works much faster than its competitors, consumes less memory, and also makes fewer disk accesses (which is why on busy servers, the difference is even greater in favor of Sypex Geo).

Creation history

For the statistics system of our Sypex CMS, we needed a module for determining the country of visitors; initially it was planned to choose one of the ready-made solutions, in particular, GeoIP was considered. Speed testing was carried out, the option with an IP database in MySQL was soon dropped due to low performance, and the option with a binary database from GeoIP (the pure php API was considered) turned out to be the fastest. We became curious why it works so quickly and looked into the source code. After review, several shortcomings of this implementation were identified.

One of the main disadvantages is that to determine the country you need 20 + n * d file readings (where n is the number of IPs to be determined, d is the number of hops on the binary tree, approximately from 3 to 32). Naturally, file operations are quite slow, so for maximum performance it is advisable to minimize their number.

For fun, we developed our own module and binary file format. The speed of which turned out to be 3-4 times faster than GeoIP, because... it contained a minimum number of accesses to the file system. Sampling requires a total of 3 + 1 * n (where n is the number of identified IPs) file readings. 

And in 2012, support for defining cities and regions was added, and the format and API itself were optimized.

About the site

On this site you can always find the latest versions of the Sypex Geo API and databases for it. For any questions regarding Sypex Geo, please use the feedback form or on the forum.

The site uses icons Yusuke Kamiyamane.