Re: the real problem with the ip-to-country DB / phpweb

From: Date: Sun, 25 May 2003 14:32:36 +0000
Subject: Re: the real problem with the ip-to-country DB / phpweb
References: 1 2 3 4 5 6 7  Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-18079@lists.php.net to get a copy of this message
Due to my "love affair" with sqlite, I did consider this, however, Ilia suggested that some scheme using shared memory will be the fastest. If we store the database in the binary equivalent to the format that you suggested, we can make some very fast lookups by incurring the overhead of a single PHP function call, rather than a whole bunch of them and their related syscalls (fseek, fread etc. etc.). Also, implementing it in C gives us the option of perhaps implementing some kind of mod_mirror for Apache, so that we can perform intelligent load balancing before we even hit the PHP engine.
OK, I am not against doing it this way. And I hope the directi data source continues to be a reliable database for ip2country information. We added checks to ensure that the DB is fully downloaded and that it is in the proper format (20 numbers, 3 chars and \n in every record), but it was not in consideration that the data itself can be incorrect. When we started to work with ip-to-country, the db was also only around 400k. Now it is 1.5MB. The question is if this big size is by error, or that 400k DB was not covering as much IPs as this 1.5MB DB does. It's quite hard to beleive that 1.5MB is needed to have this data, as the 400k DB was said to be [nearly] complete. Divyank, can you please comment on this? Goba

« previous php.mirrors (#18079) next »