Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

What is the best way to store images in the Database or Server

What is the best way to Store images in the Database or Server ?

Best way to Store Images :

a. Store the images(multiple) in the table of database or
b. Save the images in the server and store their path in the table.

Answer
1. Save the images in the server folder is best method, because retrieving images from database increases page fetch time at client end and reduces web Page loading speed. 

2. If you save the images in the database then it will increase the loading time of the application but if you save the image in the folder and path in db then the loading time of the application will be much faster

3. Depends on what you mean by "Best". It depends more on the size of each image and what kind of images they are. Storing multiple images in files system or DB will increase fetch time (DISK Reads take time). If they're all related images they can be stored as 1 single image somewhere(More on this later) and store the co-ordinates & size(w+h) of each image thumbnail in the DB. 

But what if you're trying to scale the app? Where would you store your images? And what if the server is one of the Nodes in cloud which can be swapped if the node in cloud fails? If you're going for storage on cloud, it's better to use some sort of BLOB storage that's available with leading cloud providers. Or if you're not planning for cloud, it's better to load it in LOB storage in the DB. 

Users Please post your answer too.


This post first appeared on Asp.netSourceCodes, please read the originial post: here

Share the post

What is the best way to store images in the Database or Server

×

Subscribe to Asp.netsourcecodes

Get updates delivered right to your inbox!

Thank you for your subscription

×