ASP NET MVC project architecture

Asked

Viewed 399 times

3

What would be the best way to store user files according to the requirements below:

  • The user can send one or several files at once;
  • The type of files accepted by the entire application are: mp3, jpg, png, xls, doc, ppt and pdf;
  • The architecture is all based on WCF services where there are 2 projects. The UI project that is done in ASP NET MVC 4 with the version of framework 4.5 and the WCF project also in . NET 4.5 . The database is Sql Server 2012;

My question is this: Taking this scenario what would be the best way to store these files? Serializing the files and storing in the database, save the file directly to the server drive (common upload) and store the basic file information to relate to a user or work with Filetables from Sql Server 2012?

1 answer

4


I work with this type of information every day and I can say that the ideal is to have the files saved on a file server, saving them in a folder structure that facilitates the search for them, and in the database point to that directory. It’s also worth reviewing the file server structure, preferably work with at least two HD’s in RAID or keep another server synchronized to perform redundancy and offer a top-notch service.

If you choose the other option soon you will meet the data limit set by the Express version and you will have to buy another version.

  • Felipe, I’m thinking about choosing to save the files to disk even though other people on the team prefer to save them in the database for two reasons. Server migration and system backup would be easier. But I believe the best way will be files on disk even (although the backend is not ours).

  • Perfect, show of ball! In the case of my team also we do not work with infra own, but we request mirroring of the disk and if one falls the other server that has the mirrored hard drive takes.

  • 1

    Why did you think that migration and backup would be easier by persisting the database files? Depending on the system the files will greatly exceed the size of the bank leaving it slower even for backup operations

  • My opinion and that of Thiago is not this, we said above that we prefer to save in a directory the file and save its path in the bank.

  • 1

    I am studying another way in which SQL Server 2012 manages the files. The files are saved on disk, however, the management of them is done by SQL Server 2012. This is done through Filetables. It may be a good option as well. Someone has worked that way before?

  • 1

    Very interesting, even for those who are facing problems with file server, because it simulates the file server, makes it look like it is in a file server by being filestream, is an excellent option for those who want to exchange the old file server for a Sqlserver license, as it will easily reach the limits of the express version.

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.