什么时候推荐使用 MySQL BLOB? [英] When is using MySQL BLOB recommended?

查看:40
本文介绍了什么时候推荐使用 MySQL BLOB?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个将上传和删除许多文件的应用程序,我通常只是将文件移动到服务器中的一个文件夹中,并使用唯一的 id 行命名它们.但据我所知,MySQL 还允许我存储二进制数据(文件),这在什么时候是更好的选择?

I'm coding an application that will be uploading and deleting many files, i usually just move the files to a folder in the server naming them with the row unique id. But as i understand MySQL also lets me store binary data (files) when would this be a better choice?.

请使用可靠的论据,例如何时使用 BLOB 是否意味着性能改进?.

Please use solid arguments, like When does using BLOB will mean performance improvement?.

P.S:如果重要的话,我正在使用 MyISAM.

P.S: I'm using MyISAM if that matters.

谢谢.

更新:

相关问题:
- 在数据库中存储图像 - 是还是不是?
- 该做或不该做:存储图片在数据库中(感谢塞巴斯蒂安)

更新 2

将文件存储在数据库中是不需要我想知道什么时候这是一个比存储更好的主意吗它们在文件夹中.

Storing the files in the database is not a need i'm trying to know when is this a better idea than storing them in folders.

推荐答案

阅读:

总结

如果您有时需要检索图像,它必须在几个不同的网络服务器.但是我觉得差不多了.

If you on occasion need to retrieve an image and it has to be available on several different web servers. But I think that's pretty much it.

  • 如果它不必在多台服务器,总是更好把它们放在文件系统中.
  • 如果有可在多台服务器上使用,并且实际上有某种负载系统,你需要某种分布式存储.

这篇关于什么时候推荐使用 MySQL BLOB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆