![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Is getting a file from the db and 'displaying' it, (serving it to the browser), faster than getting it off the file server? |
#3
| ||||
| ||||
|
|
Hi, My users have 10000's of images, (if not more). Currently all the images are stored in a sub folder, '/user/letter/unique_filename.ext' But I was wondering if mysql would not be slightly better at retrieving the files, (the actual data). |
|
The reason I ask is because I have few problems: 1- Backup is a bit all over the place currently, I could loose some/all my images in the case of a HD failure, I would prefer to have a slave db with all the images on it. 2- The site is growing, slowly but surely, so in the longer term it might be better to have all the images in one table. 3- Moving to another server might help. What do you think? Is getting a file from the db and 'displaying' it, (serving it to the browser), faster than getting it off the file server? |
|
Is storing images in the db a better option for a large number of files? |
|
Thanks Simon |
#4
| |||
| |||
|
|
Hi, My users have 10000's of images, (if not more). Currently all the images are stored in a sub folder, '/user/letter/unique_filename.ext' But I was wondering if mysql would not be slightly better at retrieving the files, (the actual data). The reason I ask is because I have few problems: 1- Backup is a bit all over the place currently, I could loose some/all my images in the case of a HD failure, I would prefer to have a slave db with all the images on it. 2- The site is growing, slowly but surely, so in the longer term it might be better to have all the images in one table. 3- Moving to another server might help. What do you think? Is getting a file from the db and 'displaying' it, (serving it to the browser), faster than getting it off the file server? Is storing images in the db a better option for a large number of files? Thanks Simon |
#5
| |||
| |||
|
|
Is storing images in the db a better option for a large number of files? That's where IIRC the general consensus was that the gains were to be had - better indexing than a *nix file system. |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
I have done both and I HIGHLY prefer storing images in a database. A lot of things become a lot easier and more natural. Backup, access, fsck, bulk operations, etc etc etc. If the process is a little slower, I personally do not care. I had to deal with filesystems with millions of objects, and all I want to say is NOT AGAIN. i Personally I agree. Unless its a facebook type app with millions of |
#8
| |||
| |||
|
|
I've been working with images and RDBMS's for around 25 years in live environments. Yeah... installing A/C. |
|
file systems are not really made to handle huge numbers of files. Oh FFS. |
|
~ gibberish ~ Missed you. |
#9
| |||
| |||
|
|
Simon <bad (AT) example (DOT) com> wrote: snip Congrats! You warm up a "holy war" question. Please read: http://groups.google.com/group/comp....bd1dfec0473016 Is getting a file from the db and 'displaying' it, (serving it to the browser), faster than getting it off the file server? Serving a file from disk is a highly optimized operation for a web server. Much unlike sending content that is stored as BLOB in a DBMS. For a comparison: http://mysqldump.azundris.com/archiv...Images-From-A- Database.html |
#10
| |||
| |||
|
|
Simon wrote: Hi, My users have 10000's of images, (if not more). Currently all the images are stored in a sub folder, '/user/letter/unique_filename.ext' But I was wondering if mysql would not be slightly better at retrieving the files, (the actual data). Opinions are divided. You will probably find the files quicker, because Mysql has good indexing. You may not retrieve them any quicker though, especially under heavy load...a *nix operating system will have lots of access to RAM for disk caching that MySQL may not... for example. This was discussed extensively here a few months ago, and IIRC the general compromises came down to better performance from flat files but far cleaner management and backup and general tidyness from MySQL BLOB stored images. I have a database with about a thousand images in blobs: for sure on low level of user activity it works not detectably worse than flat files. |
![]() |
| Thread Tools | |
| Display Modes | |
| |