Store pictures as files or in the database for a web app?

后端 未结 10 2007
孤城傲影
孤城傲影 2020-11-22 06:32

My question is fairly generic and I know there might not be an 100% answer to it. I\'m building an ASP .NET web solution that will include a lot of pictures and hopefully a

10条回答
  •  闹比i
    闹比i (楼主)
    2020-11-22 07:08

    In my recently developed projects, I stored images (and all kinds of binary documents) as image columns in database tables.

    The advantage of having files stored in the database is obviously that you do not end up with unreferenced files on the harddisk if a record is deleted, since synchronization between database (= meta data) and harddisk (= file storage) is not built-in and has to be programmed manually.

    Using today's technology, I suggest you store images in SQL Server 2008 FILESTREAM columns (at least that's what I am going to do with my next project), since they combine the advantage of storing data in database AND having large binaries in separate files (at least according to advertising ;) )

提交回复
热议问题