Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

database - 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...