ncis
12-10-2009, 05:53 AM
Hello,
We run some fairly large trafficked sites with millions of records, basically like business directories.
At the moment all images/pictures uploaded by the businesses are stored in the filesystem with the reference to the file location and the business ID stored in a mysql table. This works great, however backing up and restoring these folders sucks up a lot of juice from the server (we do backups nightly) when the folder gets tar'd and gzipped.
I've been experimenting with SQLite and my question is... is there any cons to using an SQLite database to store all the files along with the business ID? so there would be one table with two columns, ID (indexed) and the picture contents (BLOB).
I've tested it out on another site that had about 50k images, so what I did was during the INSERT to the SQLite database was gzipped the files bytes, then base64 encoded the string (in PHP) so the inserted content was not all the gibberish text.
Performance on that was pretty good, selecting 50 - 100 records did take a second or two but it solves my problem with dealing with large file systems as all of that content is in one file.
Anyone done anything similar or can recommend a free/open source software that can store files in a flat file but is designed to handle millions/10's of millions of records with large blob's?
I've done a lot of googling to find a solution for this for LINUX based OS's and PHP api's but didn't really find anything.
Sorry for the long post!
We run some fairly large trafficked sites with millions of records, basically like business directories.
At the moment all images/pictures uploaded by the businesses are stored in the filesystem with the reference to the file location and the business ID stored in a mysql table. This works great, however backing up and restoring these folders sucks up a lot of juice from the server (we do backups nightly) when the folder gets tar'd and gzipped.
I've been experimenting with SQLite and my question is... is there any cons to using an SQLite database to store all the files along with the business ID? so there would be one table with two columns, ID (indexed) and the picture contents (BLOB).
I've tested it out on another site that had about 50k images, so what I did was during the INSERT to the SQLite database was gzipped the files bytes, then base64 encoded the string (in PHP) so the inserted content was not all the gibberish text.
Performance on that was pretty good, selecting 50 - 100 records did take a second or two but it solves my problem with dealing with large file systems as all of that content is in one file.
Anyone done anything similar or can recommend a free/open source software that can store files in a flat file but is designed to handle millions/10's of millions of records with large blob's?
I've done a lot of googling to find a solution for this for LINUX based OS's and PHP api's but didn't really find anything.
Sorry for the long post!
