Large Text and Images In SQL

后端 未结 7 2189
栀梦
栀梦 2021-02-08 19:02

Is it a good idea to store large amounts of text (eg html pages) inside your SQL database? Or is it a better idea to store it as html files in the filesystem?

The same g

7条回答
  •  伪装坚强ぢ
    2021-02-08 19:57

    It was one of my dilemmas when I used to program PHP. Storing images like blobs in the database can make easier to manage security and permissions, but it's costly. I always used to store some metadata on the database and the binary contents on the filesystem. Access to images was not direct () but was provided by PHP scripts that checked the user authentication and authorizations through sessions before showing the image (). I suggest you to do so (whatever kind of application you're working at).

提交回复
热议问题