• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Images stored in the database

 
Alex Khvatov
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could someone tell me which is the better approach having the database store images as BLOBs or store a path to images and have a class that would sort of 'cascade' the image deletion if the row containing a path to the image is deleted from the database?

I'm just conserned with the database performance since storing images can easily make datafiles huge.

Is there an alternative approach?
I would like to know your oppinion.
Thanks.
Alex
 
Alex Khvatov
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
'opinions' of course :roll:
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alex,
If the images are very static, it is fine to point to them. If they change, it is better to store them in a BLOB. Since you mentioned wanting to delete an image when nobody is pointing to it, I think you would be better served by storing them in the database. Then the database can handle the integrity of image mangagement.

Databases are getting better at storing BLOBs. And databases are meant to store large amounts of data. From a bytes point of view, those images are still going to be stored somewhere.

Also see another thread that discusses this.
 
Sabarish Sasidharan
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How many images are we talking about? if it is going to be a few, like say 500-2000 it might just be easier storing as blobs. But if it is more than that, better to store in filesystem.

Check with ur DBA. Iam sure your DBA would not prefer storing it in the database.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic