Irish SEO,  Marketing & Webmaster Discussion

 
Make money - save the planet!

Storing IMages In Databases

This is a discussion on Storing IMages In Databases within the Coding Help forums, part of the Webmaster Help category; Hey all, Query, when uploading images to a big site pulling its content from a DB do ye store the ...


Go Back   Irish SEO, Marketing & Webmaster Discussion > Webmaster Help > Coding Help

Register Forum Rules FAQDonate Members List Calendar Search Today's Posts Mark Forums Read


Notices

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-08-2007, 02:14 PM
d-tour's Avatar
Coder
 
Join Date: Apr 2007
Location: Cork
Posts: 82
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
d-tour will become famous soon enough
Default Storing IMages In Databases

Hey all,

Query, when uploading images to a big site pulling its content from a DB do ye store the images in the database?

Personally, i have usually stored images in a seperate folder on my ftp and named them the primary key of the entry in my database. I use this method cos images will quickly eat up the db size.

Can anyone think of any issues with this method... the main one is that i use 2 seperate systems to access one piece of information, not a huge complaint but for consistancy its not ideal, and im curious if there are more issues ive overlooked?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 02-08-2007, 02:24 PM
dereko's Avatar
Coder
Recent Blog: 1time Push
 
Join Date: Jan 2007
Location: Dublin
Posts: 59
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
dereko will become famous soon enough
Send a message via Skype™ to dereko
Default

I think file system for files and database for data. I'd stick with the way you suggested first. Serializing and un-serializing will be a bigger overhead than taking the file from a file system.
__________________
JShopDesigns.co.uk - Custom E-Commerce Design and Development.
Personal Blog - Project & Employee time tracking software
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 02-08-2007, 04:07 PM
louie's Avatar
Senior Member
 
Join Date: Jan 2006
Location: Dublin, Ireland
Posts: 2,048
Nominated 5 Times in 3 Posts
Nominated TOTW/F/M Award(s): 1
louie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enough
Send a message via Yahoo to louie Send a message via Skype™ to louie
Default

I wouldn't store images in the database, but only the path to the folder.

E.G. if I have a product that can have more then 1 image, i create a form for uploading, and a separate db table to store the image name and product id, this way i could have as many images as i want per product.

On upload i always rename the images using random letter and numbers to avoid duplicates.

To display the images for a product you can use the Join query type making just one call to the db.
__________________
:. Web Design & Development Web Design Ireland
:. Search Engines Optimization Search Engines Optimization
:. Directory Submission Directory Submission
:. News & Press Release Ireland GiveItSocks.com
:. Used Cars Ireland, Car Parts & Car Audio Cars For Sale, Car Parts & Accessories
:. I Have 2 Find It Directory SEF Directory
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 02-08-2007, 07:41 PM
georgiecasey's Avatar
Member
 
Join Date: Jul 2006
Location: Galway / Ennis
Posts: 277
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
georgiecasey will become famous soon enough
Send a message via ICQ to georgiecasey
Default

I dunno, I store MP3s as blobs in a mysql database and it works well. The actual file in one table and all the metadata in another as the table. File location in the database can get messy I find.
__________________

My Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 04-08-2007, 09:49 AM
jmcc's Avatar
Wannabe Geek
 
Join Date: Feb 2006
Posts: 313
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
jmcc is just really nicejmcc is just really nicejmcc is just really nicejmcc is just really nice
Default

It depends on the number of images involved and the sizes. Some filesystems have problems with large numbers of files in a directory so they might be an argument for the use of a db. However for most applications, storing the images on the filesystems with the link in the db is the best way.

Regards...jmcc
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
databases, images, storing

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Looking for the fastest way to slice hard web images kara Webmaster Discussion 4 24-05-2007 07:56 AM
Images wbailey General Chat 1 15-01-2007 03:46 PM
Google Images - Display Method - How is it done? davidbehan Coding Help 10 12-01-2007 05:09 PM
SEO and Images on your default page sinead Search Engine Optimisation 6 05-08-2006 09:33 PM
delete images louie Coding Help 7 16-03-2006 09:06 PM


Sponsored links

Paid On Results


All times are GMT +1. The time now is 05:03 AM.


Powered by: vBulletin Version 3.7.3, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
Hosted in Ireland by Blacknight - Test your ISP |Irish Hosting Directory| Armchair.ie|Logo by Eden Web Design|Avatars by Afterglow |Latest Blog Entries | VPS HostingAd Management by RedTyger

Search Engine Friendly URLs by vBSEO 3.2.0