Stuffing images into a database
On one of my current projects it seemed best to store some photos in the MySQL database we’re using. This took me a while to decide.
Pros-
No need to worry about duplicate photo names (which is important in this project)
Less file paths to fool with
Cons-
If the database goes, the pictures go
Probably not as fast as disk access
In the end, however, the file name bit sold me. If you have several offices uploading their own photos, it’s great not having to do a lot of extra work to make sure nothing is being overwritten. As for the database corruption question, well, so much is being stored there already that the pictures would hardly be the most pressing concern. That’s why you make backups.
If anyone reads this and knows of other pros or cons, I’d love to hear ‘em.