哪个更好的方法存储图像 - 文件夹或SQL Server作为二进制? [英] Which is a better method for storing images - folder or SQL Server as binary?

查看:240
本文介绍了哪个更好的方法存储图像 - 文件夹或SQL Server作为二进制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我计划为客户开发照片库应用程序。我在asp.net 3.5中开发应用程序,并希望开发它,以便我可以使用各种前端在多个平台上重用该应用程序。基本上,我想知道将数据库中的图像作为二进制文件存在哪些不利和优势,而不是将文件简单地存储在应用程序文件夹中。



任何建议将不胜感激!



谢谢,
Tristan

解决方案

存储为二进制是您将数据库大小打到不可思议的大小。如果要使用SQL Server的快速版本,每个数据库限制为4GB,您的照片库将很快完成。



优点是您可以轻松地操纵每个文件和每个用户的访问限制。您只需查看用户权限,并决定是否退回映像。


I am planning the development of a photo gallery application for a client. I am developing the app in asp.net 3.5 and would like to develop it so that I can re-use the application across multiple platforms using various front-ends. Basically, I am wondering what are the dis-advantages and advantages of storing images in the database as binary files as opposed to simply storing the files in an application folder.

Any advice would be greatly appreciated!

Thanks, Tristan

解决方案

The disadvantage of storing as binary is that you blow the database size to incredible sizes. If you were to use an express edition of SQL Server, which is limited to 4GB per database, you photo gallery would "finish" quite soon.

The advantage is that you can easily manipulate the access restrictions per file and per user. You just look at user rights and decide whether you serve back the image or not.

这篇关于哪个更好的方法存储图像 - 文件夹或SQL Server作为二进制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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