|
Posted by The Natural Philosopher on 01/08/08 21:24
Jerry Stuckle wrote:
> missmoo wrote:
>> Hey,
>>
>> I would like to know what the differences are in terms of security,
>> reliability and resources between storing user-uploaded images in a
>> file or storing them in a mySQL database.
>>
>> Our company is starting an image-competition soon, and I am not sure
>> if I should write the php script to insert the binary code into a
>> mySQL database or if I should just store the files in a dedicated
>> folder and the data about them in the mySQL database.
>>
>> We are expecting relatively big loads of files, at least 10,000 in the
>> first 2 months.
>>
>> Which system should I use? Is there a real difference between the two?
>> our server is apache2, if that has any effects on the answer..
>>
>> Thank you!
>>
>> Moriel Schottlender
>>
>
> Not a whole lot of difference. I've been doing images in RDB's since we
> were putting scanned documents in DB2 back in the 80's. It works well.
>
> Security isn't that much different. If the images are in files, you
> need a system userid and password with write access to the files. If
> they're in a database, you need the database userid and password. (Of
> course, if the database is not accessible from the network, you need both).
>
> The downside is that you cannot server images from a MySQL database with
> a simple <img> tag. You need to write a script with will fetch the
> image and display it, then put the name of that script in the <img> tag.
> Not hard to do - it's only a few lines of code. And you can have a
> single file with the image to be used passed as a query parameter.
>
> I do both, just depending on what's needed. For instance, if the image
> is tied to other data in the database (i.e. a product image for a
> shopping cart), I'll typically store the image in the database. But if
> it's unrelated to anything else (i.e. a common header image), I'll just
> put it in the file system.
>
Agreed on all counts.
Navigation:
[Reply to this message]
|