Click to See Complete Forum and Search --> : Saving images to folder or MySQL?


mago
02-15-2006, 11:14 AM
Hello,

I’m looking at different ways to have my clients upload images (max 50 images per client and max 1 mb/image) to the server, but I’m not sure if I should keep the uploaded files in separate folders (dynamically created for each client using php) or if it would be better to keep them in a MySQL database.

My main concerns are as follows.

1) Is a MySQL database with images more vulnerable (e.g. to hacking) than a folder under public_html?

2) If the images are stored in a database, will I run the risk that the database will be slow or even inaccessible due to too many connections (i.e. too many viewers trying to retrieve images from the database simultaneously)?

3) If the answer to question 3 is ‘yes’, would dividing the images:

a. amongst two tables under the same database, or
b. amongst two databases under PHPMyAdmin

…potentially solve the problem?

4) Is there a limit to the file size or how much information you can store in a MySQL database?

5) Any other potential problems that I should know about?

Would really appreciate your input on this.

Thanks!

chazzy
02-15-2006, 09:56 PM
don't store images in a database. leads to overall poor performance. store them in directories and store the path to the file in the database somewhere.

mago
02-16-2006, 03:25 AM
I see. Thanks.

So if I would use the database for text only, what would then your answer to question 2 and 3 be?

i.e.

2) If the text is stored in a database, will I run the risk that the database will be slow or even inaccessible due to too many connections (i.e. too many viewers trying to retrieve text from the database simultaneously)?

3) If the answer to question 3 is ‘yes’, would dividing the text:

a. amongst two tables under the same database, or
b. amongst two databases under PHPMyAdmin

…potentially solve the problem?

.

chazzy
02-16-2006, 07:34 AM
it all depends on how the db is configured. i can't say one statement that will hold true for ever installation.