What is the best way to associate a file with a piece of data?

前端 未结 8 947
别跟我提以往
别跟我提以往 2020-12-29 13:52

I have an application that creates records in a table (rocket science, I know). Users want to associate files (.doc, .xls, .pdf, etc...) to a single record in the table.

8条回答
  •  失恋的感觉
    2020-12-29 14:28

    The best solution would be to put the documents in the database. This simplifies all the linking and backingup and restoring issues - But it might not solve the basic 'we just want to point to documents on our file server' mindset the users may have.

    It all depends (in the end) on actual user requirements.

    BUt my recommendation would be to put it all together in the database so you retain control of them. Leaving them in the file system leaves them open to being deleted, moved, ACL'd or anyone of hundreds of other changes that could render your linking to them pointless or even damaging.

    Database bloat is only an issue if you haven't sized for it. Do some tests and see what effects it has. 100GB of files on a disk is probably just as big as the same files in a database.

提交回复
热议问题