1

Should we put image path into database or store image as binary data into database ? If we put image as binary or image path only into database what pros and cons ? is there any security reason or what ? and if we put image as image path only what the best type data ?

Thank you.

Bobby Fiando
  • 19
  • 1
  • 2
  • 1
    I would prefer to insert the Images into database. It is easier to make a backup from one DB instead of one DB and one filesystem – Jens Jul 27 '16 at 13:31
  • 2
    Store image as blob which will be easy to handle. Don't store the image path in the db. That will be hard to maintain in future... – Naveen Jul 27 '16 at 13:33
  • 1
    i don't think that storing image into a database is a good idea. If you have a lot of images, you may want to store them into a cdn different from your server. If you look closer to websites like airbnb etc. you will notice that assets comes from other server than the one who processed the response page. – ilyass Jul 27 '16 at 13:33
  • 1
    Possible duplicate of [Storing Images in DB - Yea or Nay?](http://stackoverflow.com/questions/3748/storing-images-in-db-yea-or-nay) – fredmaggiowski Jul 27 '16 at 13:33
  • If using SQL Server... One thing to consider is the FileStream options added in SQL Server 2012 and later. The benefits of a filesystem without needing to worry about the filesystem aspects. https://msdn.microsoft.com/en-us/library/gg471497(v=sql.110).aspx – UnhandledExcepSean Jul 27 '16 at 14:57

0 Answers0