Wednesday, March 28, 2012

Images in DataBase or Server Folder?

hi everyone,

I'm currently developing a website

and have a lot of images to use there(obviously :P),

until now I have in some tables in my sql server db where exists a column which stores the path to: 'image folder + filename'

And my question is: what are the advantages of using binary images in database instead of this approach to the problem, i.e., having images stored in a server folder.

Thanks in advance.

If you store the image in the table, your queries against the table could get slower. your DB size could grow much larger. The adv is if you backup/restore you dont need to explicitly move your images or worry about updating the path if yuu just stored the path value. If you store the images on a shared drive, you can make them accessible from any production server so if you had to move your db's you just update the path with an UPDATE statement. This can save considerable time when backing up or restoring.

These are some obvious advantages/disadvantages. What works for you may not work for others. so you need to investigate thoroughly (by sufficient testing) which approach suits you best.

|||thanks for the answer.sql

No comments:

Post a Comment