Storage of large files in sql server

Which is best for storing large photos / text files on sql server. Elimination of the need for scalability, and we just work with 1 server.

I feel that saving the file path in sql is unlike blob better. It's true? If we had to scale the software, we must follow this method.

+7
source share
3 answers

It depends on the size of the files.

There is good technical documentation from Microsoft on this, here .

objects smaller than 256 KB are best stored in the database, and objects larger than 1 M are best stored in the file system. Between 256K and 1M, the read / write ratio and the speed of overwriting or replacing the object are important factors.

Of course, their findings are specific to SQL Server (2005 and 2008 R2).

+9
source

Basically it is a matter of using the right tool for the job. A lot of time and effort has been put into optimizing the relational database in order to store relational data. A lot of time and effort has been put into optimizing file systems to store files.

The former can be used to complete part of the assignment of the latter, but if there is no really good reason not to use the latter, then this is a tool more suitable for work. In almost every case, I came across saving the path to the file (and other relevant information about the file that you might want) in the database, and the actual file in FS is a more suitable approach to using the available tools.

+1
source

It is a bad idea. Unless you have special reasons to store files in data. Already discussed here: Saving images to DB - Yea or Nay?

If you still insist, read the best practice for this: here are recommendations for uploading files to the database

+1
source

All Articles