User images – database vs. filesystem storage [duplicate]

In general, it is better to store files on the file system. File systems are already tuned for storing files. However, this does have its drawbacks, particularly in terms of management, backup, restore and it is somewhat of a flimsy tie between a varchar file path field in the database and a file in the file system. What database system are you using? I think if you are using SQL Server 2008, that the new FileStream type gives a very good method for storing files in that database.

Edit: Note I’m really talking about more generally about storing files in the database. There is some extra complexity involved in trying to store images you intend to display on HTML pages in the database.

Leave a Comment