Click here to Skip to main content
15,891,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
in photosharing type of website .....it is best to store photos in database...or in website folder..for good performance of website....i heard that if we store photos i.e binary data in database it increase site load as users increases .is this is true and which is best way for that (database or photos in folder of website by storing only path in database )..please give suggestions..
Posted

 
Share this answer
 
Go for Filesystems that is Folder storage in Web Server.

Reasons and explanations are as follows.

1. ASP.Net Upload image to Database[^].

If you are developing a web site of photo sharing or albums then you can’t store images into the database, coz this will make your database very bulky to store the other profiles and data.
So, you have to adopt the first method to upload the images to a folder.

2. Which is better : Storing/retrieving images on/from SQL server or in a directory on server[^].

If content of the image is going to keep changing and application logic needs to process them before delivering it makes more sense to deliver via app server (i.e. you can keep in DB). Where as if images by nature itself is quite static - not changing often and needs to be delivered so many times, (set once read/deliver many times) scenario then, it the web is always a preferred method. this applies irrespective of performance of DB.

3. Re: Storing images in SQL database vs storing images in seperate folder and using URL image path[^].

Retrieving an image from a database incurs significant overhead compared to using the file system.
Disk storage on database SANs is typically more expensive than storage on disks used in Web server farms.

4. Where should I store photos? File system or the database[^].

Filesystem, of course, unless you're aiming for a story on thedailywtf. The easiest way is to have the photos organized by a property you can derive from the file itself, such as its SHA-1 hash. Then just store the hash in the database, attached to the photo's primary key and other attributes (who uploaded it, upload date, etc).

Thanks...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900