Possible Duplicate:
Storing Images in DB - Yea or Nay?
Which approach is better? What are the advantages and disadvantages?
Advantages of storing images in database, in my opinion, are:
- database integrity (it's easier to keep all database entries valid with foreign keys than to keep an eye on filesystem and make required changes there during each change in database)
- less work and easier maintenance (you only need to take care of one place of data storage - database)
Disadvantage would imho be:
- greater load on database server
Do you agree with the points above?
Currently what I do is I store small images such as avatars and thumbnails in the database as BLOBs and I store large images such as full size photos or wallpapers in the filesystem. Do you think this is a good approach? If yes, is there some magic number (file size) that decides if it's still advantageous to store an image in the database or not? If not, should I store all images just in one place (database or filesystem)?