I have to manage some files in a web application, let's say the avatar images of user profiles. I asked myself: should I use a blob field in user's database table or simply in a filesystem file like avatars/{userid}.jpg? What are advantages to store blob into database if I do not need search capabilities in this field?
2 Answers
One thing to consider is also the number of files. If you have to manage a large amount of files (>10.000 at least) you have to think of organizing the files in a directory - structure, otherwise some filesystems may get slow. The DB usually takes care of that.
Also, if a user already has a connection to a database, you do not need to worry to setup a shared file to which all the users can connect. On the other hand, single file security management is a little harder in the database, sind you have to do it yourself.