Solved

asp.net storing images in the database versus the file system

Posted on 2014-10-27
3
303 Views
Last Modified: 2014-10-28
I am updating an old asp classic website. The old website stores the images on the file system. I am updating to asp.net where I upload and store my images in the database.

I've read some pros and cons on storing in the database versus the file system; but it's not really clear what the final recommendation is. Can anyone just tell me in a nutshell what you believe the pros and cons are?

1. I will need to import my file system images into my database. Will this be possible to read the images from the hard drive and then put them into the database? (If yes, I will ask a new question on how to do that.)

2. I will be using a cloud server and when it needs to spin up a new copy of the database for replication, will having the images in the database cause any problems?

3. Will my costs be greater? I will be using Rackspace cloud, so if I just have a file sharing server versus storing images in the database, what might be the difference in storage costs? Any ideas?

4. The structure of my field for storing the image is this, any suggestions on something else? I am using VS2008 now for testing, but will up to 2012 when I move to the host.
[UserProfileImageContent] [varbinary](max) NULL,

thanks!
0
Comment
Question by:Starr Duskk
3 Comments
 
LVL 33

Accepted Solution

by:
ste5an earned 250 total points
ID: 40408142
1. Yes.
2. Yes. Your database is larger, thus replication will take its time. btw, what kind of replication?
3. Depends. Are you charged by storage? Also requesting the images from database should cost more CPU.
4. Consider using FILESTREAM. This allows your web server to read the images like normal files (over a share).
0
 
LVL 44

Assisted Solution

by:AndyAinscow
AndyAinscow earned 250 total points
ID: 40408177
Files in the file system could get moved/deleted/renamed.  When stored in the database then they are 'safer' - but at a cost (the database is BIGGER).
0
 
LVL 1

Author Closing Comment

by:Starr Duskk
ID: 40408732
Thanks! I've decided to going with storing the images on the drive.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now