我应该将图像存储到数据库还是硬盘上? [英] Should I store images into database or on hard drive?

查看:194
本文介绍了我应该将图像存储到数据库还是硬盘上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友.

我正在VB 2008中进行薪资项目.我需要存储每个员工的图像.因此,我想问我应该将这些图像存储到数据库(Sql Server)还是在硬盘驱动器上?
请告诉我最好的存储图像的方法,这样我的程序就应该高效.而且Plz还会解释您建议的图像存储方式的优点.
我将非常感谢.

Dear Friends.

I am working on a Payroll Project in VB 2008. I need to store the image of each employee. So, I want to ask that Should I store these images into the database (Sql Server) or on the hard drive?
Plz tell me the best way to store images, so that my program should be efficient. And Plz also explain the advantages of your suggested way of image storing.
I will be highly thankful.

推荐答案

通常,我更喜欢数据库-
1)文件路径轻松无忧(轻松访问多个系统)
2)索引选项
3)Sql server的可靠性

但是,如果只需要存储少量映像(用于小型应用程序),则可以考虑hardrive-SQL Server在投资和维护方面有开销.
Presonally, I prefer the database -
1) No headache with file paths (easier access across multiple systems)
2) Indexing options
3) Sql server reliability

However, if you need to store only a few images (for a small application), you could consider the hardrive - SQL server has an overhead - in terms of investment and maintenance.


考虑这些可能是大头照(最大10-15 KB),您应该只将它们存储在数据库中.通常,人们建议不要这样做,因为将大图像存储为Blob数据通常效率不高.但是除非您具有Web服务或Web应用程序,否则您可能应该只在DB中执行此操作,因为替代方法将涉及某种从服务器硬盘读取和写入数据的机制.
Considering these are probably mug shots (max 10-15 KB), you should probably just store them in the DB. In general people advise against this because it''s usually inefficient to store large images as blob data. But unless you have a web-service or this is a web-app, you probably should just do it in the DB, since the alternative would involve some mechanism to read and write from the server hard disk.


嗨.
这是C#中非常好的文章.
http://www.codeproject.com/KB/cs/images_in_sql_server.aspx [ ^ ]
Hi.
This is very good article in C#.
http://www.codeproject.com/KB/cs/images_in_sql_server.aspx[^]


这篇关于我应该将图像存储到数据库还是硬盘上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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