Re: Uploading Files Should I use MySQL or Server for storage?
| From: | Jonathan | Date: | Mon, 21 May 2007 08:00:09 +0000 |
| Subject: | Re: Uploading Files Should I use MySQL or Server for storage? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-255277@lists.php.net to get a copy of this message | ||
benc11@gmail.com wrote:
I am in the process of adding a part to my website which would include pictures, pdf files, txt files, and excel files. The files sizes could be anywhere on average of 100k to 2mb. Do you think I should be uploading the files to a MySQL database or to my server? I have head that there are pros and cons to both, but have never really received a definitive answer that helps much. I appreciate all your opinions on the pros and cons of both.benc11, I store most of my data in both. when i do image processing i usually upload the image, store the original in the database, process the image into its subsequent sizes or resolutions and store them on the file system. If the images get lost on the file system or my application can not find them I have the original stored in the db for reprocessing. I store files other than images, PDF DOC etc... in the database and on the file system. i serve the document from the file system because regardless of the thread of conversation it is in my experience that 99% of the time it is faster to do so. if its not found i know i have a fall back in that it is also stored in the database so i serve that. Sure my method uses more storage space, but I sleep at night knowing I have added redundancy. Kind regards, Jonathan