Definitely outside the database...
Even MS have recognised it and created a new type/function, FILESTREAM as acperkins mentions above. It is good, but it also means that SQL Server "OWNS" the images. They are stored externally, but considered part of the database "suite" so to speak. Meaning included in backups and all that stuff without bloating the actual database. It is a slightly different approach, and does take a bit of management, for a start the SQL Server service owner effectively becomes the owner, so it does require a bit of planning.
I still prefer external files when they are more "user bound" images. For example, a product image from the inventory master is ideally suited to FILESTREAM, we as user supplied images can be more easily managed over a shared network drive space.
The other thing is if external packages need to interact with the image. FILESTREAM is really a finished goods type proposition, true it can manage versions a lot better, but is more of a submission of "here it is" and the resulting file is no longer recognised (well by name at least) - SQL does it's own thing with the actual files.
So, horses for courses as to when filestream is best used over external files with a path held in the database. Main thing is "who is going to own the file" and may well depend on how other applications are going to interact with it.
In your case, being classifieds, it would be a toss of the coin. There are distinct advantages in using FILESTREAM, after all it is like an inventory type system, and will be backed up as well, and then there are flexibilities in external images. Over the web, you need to consider speed and traffic. With SQL being the owner, it will also be delivering the image. Externally, you might be able to get away with an image library on the web server and relieve some network traffic.
Bottom line. External - your choice filestream or flat files with a path in the DB - either way.
here is some other links for you :
MS details : http://technet.microsoft.c
intro / discussion : http://www.sqlmag.com/arti
with samples : http://blogs.msdn.com/mani
Main Topics
Browse All Topics





by: acperkinsPosted on 2009-04-13 at 18:40:56ID: 24134388
If you are using SQL Server 2008, then there is a hybrid approach using the new FILESTREAM data type. Take a look at this article: /sql/learn -sql-serve r/sql-serv er- 2008-th e-new-data -types/
SQL Server 2008: The New Data Types
http://www.simple-talk.com