|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Uploading images and assigning to content
Just a quick question, I was wondering what the best approach would be simply for performance; ease and general good programming practice reasons.
Using ASP and SQL Server. If I was to build an image upload routine and then when I create an new piece of content such as an article and assign an image to it should the image be stored on disk in the file system and the name of the image referenced in the database along with the content being saved or should the image be stored along with the content item in the database? I always used packaged content management solutions in the past, which always store the image on disk and does all of the hard work for you, however, now I wish to do this myself in ASP and wondered what the best approach was. Thanks in advance. |
|
#2
|
|||
|
|||
|
Its completely a trade-off issue.
If you insert images in the database field, retrieving image is always a faster. But image size may be an issue for the operating system ( I mean operation system may delimit the size). On the otherhand, keeping image under a folder is always easy to maintain or update ( or probably you will use a single image for multiple ref.), but little slower to retrieve if there are huge number of images under same folder. In my project, I had to maintain about 100,000 images, I devided them logically under 4 diff. folder. However, When Intel are about to introduce a Hyperthread Processor sLike P4. In future how you organize your images wont be performance factor for any of the above approach. |
|
#3
|
||||
|
||||
|
CPU doesn't really have much to do with it as most decent DB's store their content memory.
I've always found that the filesystem method is the best. It's very easy to maintain, clean, and there's no hassles pulling the filename string outta the DB. The DB method is messy, bloated and clunky, streaming the data to the broswer, setting content-types, etc... blah... Go the FS route. |
|
#4
|
|||
|
|||
|
Thanks guys.
Just as I thought, I didn't really want to go down the dB route but thought I would double check that my reasons were correct. Thanks. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > Uploading images and assigning to content |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|