MySQL BLOB vs存储小PNG图像的文件? [英] MySQL BLOB vs File for Storing Small PNG Images?

查看:146
本文介绍了MySQL BLOB vs存储小PNG图像的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更好的做法是将大量小PNG图像(大多数<5KB)存储在我的数据库中作为BLOB,还是将它们作为图像文件存储在目录中更好?

Is it better practice to store a lot of small PNG images (<5KB mostly) in my database as BLOBs or would it be better to store them as image files in a directory?

推荐答案

这取决于对您来说更重要的事项:速度,访问的便利性,......

It depends on what is more important to you: speed, ease of access, ...

如果你有一个应用程序,你必须在概念上将图片绑定到记录(例如联系人应用程序),我会采用dbms的方式。它可能不是那么快(一些非常主观的东西),但它更容易处理。

If you have an application in which you have to bind conceptually a picture to a record (eg. contacts application) i would go the dbms way. It may be not that fast (something which is very subjective) but it is much easier to handle.

如果要备份数据,将数据存储在dbms中要简单得多! (考虑到您必须只发出一个备份命令,并且已备份所有数据)。

It is also much simpler to store pics in a dbms if you want to back up your data! (consider the fact you have to issue only ONE backup command and you have backed up ALL your data).

我怀疑你以某种方式存储了绑定到图片的其他数据。如果这是真的,我肯定会采用dbms的方式。如果这不应该是真的比不打扰设计一个模式,创建dbms,创建连接,存储数据,....开销很大!

I suspect that you have somehow to store other data which is bound to pictures. If this holds true than i would definitely go the dbms way. If this should not be true than don't bother designing a schema, create the dbms, create connections, store data,.... to much overhead!

这篇关于MySQL BLOB vs存储小PNG图像的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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