日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

mysql 存储二进制数据_为什么在MySQL中存储二进制数据?

發布時間:2023/12/4 数据库 50 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mysql 存储二进制数据_为什么在MySQL中存储二进制数据? 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

I'm a little confused - what are the pros of storing binary data in DB? Is it for security reasons, or there are some more complicated motives i don't see?

Thanks for your time.

解決方案

As opposed to what? Putting it in the filesystem?

The drawbacks to using the filesystem for binary file storage would be:

you don't get ACID compliance;

if you might be hosting the application on more than one server (eg load-balancing, failover), you have to work out some kind of shared file storage to avoid the backend getting out of sync;

having only one storage backend instead of two makes deployment simpler.

So with database-only storage, you don't have to worry about creating a folder with write access for the web user, the whole app can be read-only. If you need to move the application, you can just check it out of source control and point it to the database without having to copy more file data across. Your database backups can be covering everything instead of having to have a separate file backup step. And so on.

On the other hand the drawbacks to database BLOB storage:

unwieldy for very large files;

you don't get to use the web server to serve the files up efficiently for free.

總結

以上是生活随笔為你收集整理的mysql 存储二进制数据_为什么在MySQL中存储二进制数据?的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。