Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Storing Images : DB or File System -

I read some post in this regard but I still don't understand what's the best solution in my case.

I'm start writing a new webApp and the backend is going to provide about 1-10 million images. (average size 200-500kB for a single image)

My site will provide content and images to 100-1000 users at the same time.

I'd like also to keep Provider costs as low as possible (but this is a secondary requirement). I'm thinking that File System space is less expensive if compared to the cost of DB size.

Personally I like the idea of having all my images in the DB but any suggestion will be really appreciated :)

Do you think that in my case the DB approach is the right choice?

like image 912
mickthompson Avatar asked Aug 05 '09 16:08

mickthompson


1 Answers

Putting all of those images in your database will make it very, very large. This means your DB engine will be busy caching all those images (a task it's not really designed for) when it could be caching hot application data instead.

Leave the file caching up to the OS and/or your reverse proxy - they'll be better at it.

like image 179
bdonlan Avatar answered Nov 15 '22 13:11

bdonlan