什么是存储图像的最佳方法 [英] what is best approach to store images

查看:64
本文介绍了什么是存储图像的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我想知道,



什么是最好的商店方法图像?



将图像存储在数据库或文件夹中n只将数据存储在数据库中???



因为,我在托管服务器上都有(数据库n网站)。



Plzzzz ....伙计们让我知道,我有什么实现。



谢谢

Hi guys,

I want to know,

What will be best approach to store images?

storing the images in the database or in the folder n just storing its url in d database???

Because, i have both(database n website) on the hosting server.

Plzzzz.... guys let me know, what i have to implement.

Thanks

推荐答案

我建​​议将音频和视频文件存储在某个存储设备中将其路径和元信息存储在数据库中。当您需要检索这些媒体文件时,请在数据库中查找它们的路径。

了解更多:什么是最好的存储媒体文件在数据库上的文件 [ ^ ]
I suggest storing the audio and video files in some storage device and only store their paths and meta information in the database. When you need to retrieve these media files, then look for their paths in the database.
Read more: what-is-the-best-way-to-store-media-files-on-a-database[^]


按照我过去的回答 - 在照片共享类网站中.....最好将照片存储在数据库中。 ..或在网站文件夹.. [ ^ ]。
Follow my past answer - in photosharing type website .....it is best to store photos in database...or in website folder..[^].


恕我直言,没有'最佳方法'。

在数据库中存储图像(二进制大对象 - BLOB)的主要原因首先是添加一些订购/构建BLOB数据的能力。所以,如果这不是你的情况(你只寻找存储)不要!

BLOB有两个主要问题

1.编码二进制数据所以它的内容不会破坏SQL

2.与文件系统存储相比速度慢

因此,如果您没有理由在SQL中存储,请使用文件系统。

但是在文件系统上存储具有单独安全性的缺点,因为不允许进入SQL的人可能会从文件系统中删除文件...

为此您可以使用 FILESTREAM [ ^ ],自SQL 2008以来就存在...
IMHO there is no 'best approach'.
The main reason to store image (Binary large object - BLOB) in database in the first place is to add some ability to order/structure your BLOBs data. So if this is not your case (you only look for a storage) do not!
There are two main problems with BLOB
1. encoding the binary data so it's content will not break SQL
2. slow in comparison to file system storage
So if you have no reason to store in SQL do it with the file system.
However storing on the file system has the disadvantage of separate security, as someone not allowed into SQL can possibly delete the files form the filesystem...
For that you may use FILESTREAM[^], that exists since SQL 2008...


这篇关于什么是存储图像的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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