tags:

views:

82

answers:

2

Possible Duplicates:
Saving images in database mysql
Storing Images in DB - Yea or Nay?

I just found out it's possible to store images in a mysql database. I just want to know if this is considered good or bad practice strictly in terms of performance. For a large scale site which would be better, storing the images in mysql or only there paths and having the images stored on the server's file system?

(assuming PHP will be used as the scripting language to retrieve and display the images on the site)

A: 

Store the images on disk and store paths (or rather identifiers, that can be translated into files, so that the system can be moved. Store the identifier 12345 and translate this to /path/to/image12345.jpg) in the database. If you ever need to migrate the database you won't want lots of images in there!

fredley
A: 

in terms of performance.
database way:

  • client requests an image from a web server
  • web server passes request to php
  • php querying a database. getting image binary content in memory
  • php passing image binary content to web-server
  • web server sending an image to client

filesystem way

  • client requests an image from a web server
  • web server sending an image to client

Conclusions are left for you to made

Col. Shrapnel