Re: image thumbnail from blob data
| From: | Phpster | Date: | Mon, 07 Jun 2010 00:24:54 +0000 |
| Subject: | Re: image thumbnail from blob data | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-305865@lists.php.net to get a copy of this message | ||
On Jun 6, 2010, at 5:51 PM, Paul M Foster <paulf@quillandmouse.com> wrote:
On Sun, Jun 06, 2010 at 09:55:20PM +0100, Ashley Sheridan wrote: <snip>In my experience, most RDBMs fail at blobs and internally they still store it as a file with a pointer. It's also worthwhile noting that in all cases, after a certain size in the db is reached, performance is impacted. With mysql, it seems to be about 12gb and with SQL server it's around the 15gb size. I had to write a script that would pull those images and store them on the file system and when run, it reduced the size of the db to about 1 gb in all instances, if not smaller. This dramatic change reduces back up time and costs, making the clients way happier since the performace also picked up. As mentioned, it's just not worth storing in the db. Bastien Sent from my iPodHaving said that, it's not generally a good idea to store images as blobs in my experience. It can create slowdowns in database access, and increases the amount of space the db requires by a lot! What most people do I've found is to store the image as a file and store the path and filename to it in the db. However, if the location is going to change often then it might be best to store it as a blob like you're doing.+1 Storing blobs in an RDBMS is an abuse of the technology, IMO. RDBMSes were not originally designed to store this type of information, and as Ash pointed out, it still can create problems. His assessment of the preferred method for storing this type of information is spot on. Store them in a file and then store the file location in your database. I don't know, but this might be use case for the new generation of NoSQL databases. I have very little knowledge of how they store data, but I would assume they're more accustomed to storing blobs and whole documents. And if not, then someone should come up with one which works this way. It would be relatively simple to create a key-locaton table (using dbm or somesuch) and have all the actual "data" stored in files. Paul --Paul M. Foster --PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php