在SQL Server中存储图像 [英] storing images in sql server

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

问题描述

我正在尝试将数据库设计用于存储图像.你们中的许多人可能具有设计db来存储图像的经验以及与之相关的挑战.

I am trying to put together db design for storing images. Many of you might have had experience designing db to store images and the challenges associated with it.

数据库最终可能存储数十万张图像.我打算使用SQL Server 2008数据库和实体框架.计划使用FILESTREAM数据类型来存储图像.以下是我考虑为db中的每个图像存储的属性列表.

The db might store hundreds of thousands of images eventually. I am planning to use SQL Server 2008 db and entity framework. Planning to use FILESTREAM datatype for storing images. Following is the list of attributes i have considered storing for every image in db.

图像名称,图像类型,图像宽度,图像高度,图像水平分辨率,图像垂直分辨率,图像位深度以及最终的实际图像数据.

Image Name, Image Type, Image Width, Image Height, Image Horizontal Resolution, Image Vertical Resolution, Image bit depth and finally actual image data.

我要弄清楚的事情: 1)我很好奇,如果我错过了图像的任何其他关键属性. 2)由于使用FILESTREAM数据类型,将图像存储在文件系统上时,执行db备份时会产生什么影响?

Things i am trying to figure out: 1) I am curious, if i have missed out any other crucial attribute of an image. 2) What could be the impact while doing db backup as the images are stored on the file system due to use of FILESTREAM data type?

谢谢! 陈

推荐答案

1)我可能在这里做一个疯狂的假设,但是如果您的图像将是数码照片,那么您可能需要考虑存储

1) I may be making a wild assumption here, but if your images are going to be digital photo's then you may want to consider storing Exif metadata attributes that all(if not, 99%) digital cameras generate.

2)使用文件流执行备份没有影响,SQL Server在这里完成了所有繁重的工作. Filestream数据将是数据库.BAK文件的一部分,因此您无需执行任何其他文件系统备份.

2) No impact in performing a backup with filestream, SQL Server does all the heavy lifting here. Filestream data will be part of your database .BAK file, so you wont need to do any other file system backups.

您可能没有想到的是,由于FILESTREAM是一项新功能,因此因此不能与其他一些sql服务器功能一起使用,例如:

What you may have not considered is that as FILESTREAM is a new feature & thus can't be used with some other sql server features such as:

  • 数据库镜像
  • 复制(无法复制文件流列)
  • 数据库快照

这篇关于在SQL Server中存储图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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