an ASP.NET Open Source CMS & eCommerce platform
Search:
Skip Navigation LinksHome > DotShoppingCart Forums > Development > General Programming > Why store the images on the database ?
Last Post 9/8/2008 2:04:22 PM By lukezy. 4 replies.
9/8/2008 3:06:24 AM
dracnet
Posts: 3
Joined: 8/5/2008
Location:Barcelona, Spain
Why store the images on the database ?
<span class="Apple-style-span" style="font-family: Verdana; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">Why store the images on the database ? </span>
It's really a good practice ? 
9/8/2008 8:35:35 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Why store the images on the database ?
Storing images inside database shouldn't be any issue. Generally SQL server manages memory and space better than OS.
 
One of our design goals of DotShoppingCart is the easy backup and ablility to move from one server to another server due to capacity reason. So we decided to store images inside database as the central repository. During runtime images are extracted and cached in the file system of the web server farm to speed up image serving. As a result all you need to backup the DotShoppingCart is to backup the database.
DotShoppingCart Staff
9/8/2008 9:22:01 AM
dracnet
Posts: 3
Joined: 8/5/2008
Location:Barcelona, Spain
Re: Why store the images on the database ?
 ok, so you take the best of both worlds (Database and filesystem)
there're tons of webs talking about databases vs filesystem, pe:
btw,thanks for your fast reply
9/8/2008 9:28:12 AM
dracnet
Posts: 3
Joined: 8/5/2008
Location:Barcelona, Spain
Re: Why store the images on the database ?
 another interesting post
9/8/2008 2:04:22 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Why store the images on the database ?
Thank you for the links.
 
Here are some more background information. IIS handoffs serving a file to the kernel level, which is much faster serving files from ASP.Net pipeline directly. To cache images on the file system greatly improve the scalability. 
 
DSC (DotShoppingCart), stores the original size of images in DB. Images are shown as different sizes (thumbnails) at several different places. DSC allows you to configure the sizes of images for these places. On the fly DSC creates the thumbnails according to the configurated size and caches those in the file system on the web server farm.
DotShoppingCart Staff