哪种方法更好 [英] Which one approach is better

查看:117
本文介绍了哪种方法更好的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我正在开发一个应用程序,该应用程序将为一个配置文件处理多个图像,因为我有两个选择将图像存储在SQL中:

a)我可以将图像转换为字节数组并将其作为图像数据类型存储在SQL中,并且
b)每当上传图像时,我都可以更改其图像名称,并将其保存在任何位置,并将该位置的路径存储在数据库中

现在,我变得困惑于哪种方法更好,无论是第一种还是第二种,甚至我都能够实现.

请让我知道这两者的优缺点将有很大帮助.

在此先多谢.

最好的问候
Tanveer

Dear All,

I am developing an application that will deal with multiple images for a single profile, for that I have two option to store image in SQL:

a) I can convert image into byte array and store it in SQL as image data type, and
b) I can change the image name whenever it is being uploaded and save it in any location and store that location''s path in database

Now I am getting confuse that which approach is better, either first one or else second one even I am able to implement both.

Please let me know the advantage and disadvantage of both this will be a great help.

Thanks a lot in advance.

Best Regards
Tanveer

推荐答案

我的两分钱-

如果您有少量图像(配置文件记录),请以本地驱动器方法进行存储.
如果您有大量的图像(配置文件记录),请使用数据库.
My two cents -

If it you have a small set of images (profile records), go for the store in local drive approach.
If you have a large set of images (profile records), go for the database.


好吧,我认为大多数人都同意您的第二种方法.基本上,检索要比将其保存到数据库快得多.试想一下,与仅将其存储在文件服务器中以及将路径存储在数据库中相比,上载3MB文件然后在以后检索它时需要执行的转换.显然,在第一个处理上还有更多处理.
Well I think most will agree with your second approach. Basically, the retrieval are pretty much faster than if it were saved to database. Just imagine the conversion that you need to do when you upload a 3MB file, and then retrieve it later on, as compared to just storing it in a file server, with your path in the database. Obviously, there are more processing done on the first one.


如果您看一下flickr.com,它处理许多图片,那么我认为它们将所有图像保存在文件系统和数据库中,以供处理.位置参考.
If you look at flickr.com that dealing with many pictures, then I think they save all image on file system and a database for reference to locations.


这篇关于哪种方法更好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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