MySQL Forums
Forum List  »  Newbie

Re: Where are BLOBs useful?
Posted by: Rick James
Date: June 02, 2011 07:33PM

Whether to store, say, images in a BLOB or in separate files -- this is a frequent debate.

The argument in favor of storing in a BLOB is consistency. With a separate file, you are more likely to accidentally delete the db row or the image file without removing the other part of the pair. If both are in the database, either in the same row, or in a separate table, things are 'safer'. If in separate tables, "ON DELETE CASCADE" can even make it so that deleting one automatically deletes the other.

Is this a sufficiently strong argument? You decide.

With images to be displayed on a web site, it is arguably more convenient to use the db generating the <img src=...> tag, and separately serve the image directly from the web server without touching the database.

Options: ReplyQuote


Subject
Written By
Posted
June 01, 2011 02:59PM
Re: Where are BLOBs useful?
June 02, 2011 07:33PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.