-2

Possible Duplicate:
Storing Images in DB - Yea or Nay?

I was hoping to store some images taken from a camera and to store them in the database on the device. The question that i am asking is.

Is it best practice to store the image inside the actually database or can i just store the path to the image in the database. Ofcourse i would have to worry about them deleting the picture?

Thanks you in advance StackOverFlow nation for your help and support

Community
  • 1
  • 1
Lpc_dark
  • 2,834
  • 7
  • 32
  • 49

1 Answers1

3

In my opinion its generally better to store images on the file system and save the references to the images in the DB(make a look up table) unless you are already getting your image data in encoded format. In the db you will eventually have to refactor/remove it out when you start seeing all kinds of performance issues with your database. Worrying about users deleting files might be a tradeoff to better performance. There are ways to prevent this from happening ( distribute over the file system, obfuscate file and folder names and so on). There are also ways to check if users are deleting files(maybe you schedule a regular backup check and search for missing files.)

Vrashabh Irde
  • 14,129
  • 6
  • 51
  • 103