Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ben21
Starting Member
5 Posts |
Posted - 2005-09-04 : 09:04:03
|
| Hi, I'm in the early stages of planning an image gallery that will start with ~1000 hi res JPG images each of about 3mb. My question is: If i stored the images as bytes in a databse how big (in megabytes) can i expect the database to be when compared with the equivalent storage space required for normal files?I'm trying to figure out if its best to store image files as normal files or have them stored in a database. Using a sample of 1000 files taking up 3gb - would i need a 3gb MSSQL database?And also: Is storing large numbers of images in a DB the best architecture or is there a more cost effective / efficient solution? Thanks in advance!Ben |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-09-04 : 09:15:57
|
| Hi ben21, Welcome to SQL Team!"Is storing large numbers of images in a DB the best architecture or is there a more cost effective / efficient solution?"Generally it is regarded as "better" to store the image files in the file system, and its path and/or filename in the database.Exceptions to this are where security is important, and perhaps where disaster recovery, or replication, onto another site needs to be "atomic"Getting large files [anything bigger than 8,000 bytes] in/out of SQL Server is more painful than regular data.You would probably find it easier to construct a backup plan (assuming substantial diskspace required for the images) by "archiving " the images as a separate task to backing up the database.Kristen |
 |
|
|
ben21
Starting Member
5 Posts |
Posted - 2005-09-05 : 06:09:33
|
| Hi KristenThanks for the response, i'm comming to the conclusion that its better to store the images as normal files, the shear size of the DB, the cost and the backups etc are probably not worth any benefit.The only other thing i thought of was that by storing images in a DB i'd be able to have a function that would scale images to allow users to download lower resolution versions. Maybe there is some server software / script i can use to scale the files...Thanks again.Ben |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-09-05 : 15:19:11
|
| Web application?Want to cheat? <g>You can just change the HEIGTH and WIDTH properies of the IMG tag and the browser will scale them - but of course the user will have downloaded the whole of the "large" file before that happens - OTOH they will have the real image cached on their machine, so when they want the full version there is no download-delay.We use a cheap-and-cheerful (IIS compatible) utility that allows images to be resized, rotated, and "stamped" with some text (in our case a copyright message)However ... I'm at home and can't remember its name. If it sounds like that would be helpful give me a shout and I'll dig out a URL tomorrow.Kristen |
 |
|
|
ben21
Starting Member
5 Posts |
Posted - 2005-09-12 : 05:23:40
|
| kristen,The idea is to do something like istockphoto.com where higher res images cost a bit more. So i only want small copyrighted or watermarked images available until after payment.Your utility sounds just the job so if you have the URL to hand i'd appreciate it.ThanksBen |
 |
|
|
Kristen
Test
22859 Posts |
|
|
|
|
|
|
|