将图像存储在数据库中与存储在文件系统中

I am working on a online shopping website, it will have product images also. I have confusion regarding were i should store images. If I store these images in the database image url must be kept into the database and if i store image in blob format i have to decode it before using in php. Can anyone tell which one will be better choice?

I think the best solution is to keep the Database clean of any images. Below are number of reasons -

  • Database will soon start to grow
  • File system is good for storing files
  • You have put extra effort to decode them in PHP(Resource overhead)
  • Many databases I have studied keep the images in the File System (WordPress source)

Hope it helps