Domanda

I am implementing a file sharing system in ASP.NET MVC3. I suppose most file sharing sites store files in a standard binary format on a server's file system, right?

I have two options storage wise - a file system, or binary data field in a database.

Is there any advantages in storing files (including large one's) in a database, rather then on file system?

MORE INFO:

Expected average file size is 800 MB. 3 files per minute are to be usually requested to be fed back to the user, who is downloading.

È stato utile?

Soluzione

If the files are as big as that, then using the filesystem is almost certainly a better option. Databases are designed to contain relational data grouped into small rows and are optimized for consulting and comparing the values in these relations. Filesystems are optimized for storing fairly large blobs and recalling them by name as a bytestream.

Putting files that big into a database will also make it difficult to manage the space occupied by the database. The tools to query space used in a filesystem, and remove and replace data are better.

The only caveat to using the filesystem is that your application has to run under an account that has the necessary permission to write the (portion of the) filesystem you use to store these files.

Altri suggerimenti

Use FileStream when:

  1. Objects that are being stored are, on average, larger than 1 MB.
  2. Fast read access is important.
  3. You are developing applications that use a middle tier for application logic.

Here is MSDN link https://msdn.microsoft.com/en-us/library/gg471497.aspx

How to use it: https://www.simple-talk.com/sql/learn-sql-server/an-introduction-to-sql-server-filestream/

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top