manage uploaded files in database or file system?

﹥>﹥吖頭↗ 提交于 2019-11-29 14:57:45

From my point of view, file system is the best choice.

  1. Your database is not getting oversized because of BLOB fields
  2. You store only filenames as strings and you possibly can index on them (if you give meaningful names to your files)
  3. If you run out of space it is much easier to plug new HDD than migrate your DB.

The only drawback here is that someone (even you) can accidentally delete files much easier than BLOB fields.

There are pros and cons for both approaches. Keeping files in DB will make management much simpler. From another side, files stored on filesystem can be delivered more effectively, saving IO and CPU resources.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!