English 中文(简体)
图像二元是否应当储存在一个服务器中,作为BLOBS?
原标题:Should image binaries be stored as BLOBS in a SQL Server?

如果申请要求将图像(如JPGs、PNGs等)放在数据库驱动的应用中,这些图像是否刚刚储存在一个档案系统中,其路径在数据库中被参照,或者这些图像是否实际上被储存在数据库中。

最佳回答

微软研究公司的一份真正好的论文称为。 To Blub or Not To Blu

Their conclusion after a large number of performance tests and analysis is this:

  • if your pictures or document are typically below 256K in size, storing them in a database VARBINARY column is more efficient

  • if your pictures or document are typically over 1 MB in size, storing them in the filesystem is more efficient (and with SQL Server 2008 s FILESTREAM attribute, they re still under transactional control and part of the database)

  • 在这两者之间,视您的使用情况而定,这只是一个 to子。

如果你决定将照片列入服务器表,我将强烈建议使用单独的表格储存这些照片——不把雇员的同位素储存在雇员桌上——将其保留在一个单独的桌子上。 这样,如果你不总是需要选择雇员的同位素,作为你询问的一部分,雇员表格可以保持精干、平均和高效。

关于档案组,请查看Files和Filegroup Construction。 基本上,你会创建自己的数据库,从一开始就建立一个单独的大型数据结构档案组,或以后再增加一个档案组。 让我们称之为“LARGE_DATA”。

现在,如果你有一个新表格,以制作需要储存VARCHAR(得奖)或VARBINaire(得票)一栏的新表格,你可以说明这一大数据档案组:

 CREATE TABLE dbo.YourTable
     (....... define the fields here ......)
     ON Data                   -- the basic "Data" filegroup for the regular data
     TEXTIMAGE_ON LARGE_DATA   -- the filegroup for large chunks of data

检查档案组内的MSDN,并与它一起玩!!

问题回答

暂无回答




相关问题
what is wrong with this mysql code

$db_user="root"; $db_host="localhost"; $db_password="root"; $db_name = "fayer"; $conn = mysqli_connect($db_host,$db_user,$db_password,$db_name) or die ("couldn t connect to server"); // perform query ...

Users asking for denormalized database

I am in the early stages of developing a database-driven system and the largest part of the system revolves around an inheritance type of relationship. There is a parent entity with about 10 columns ...

Easiest way to deal with sample data in Java web apps?

I m writing a Java web app in my free time to learn more about development. I m using the Stripes framework and eventually intend to use hibernate and MySQL For the moment, whilst creating the pages ...

join across databases with nhibernate

I am trying to join two tables that reside in two different databases. Every time, I try to join I get the following error: An association from the table xxx refers to an unmapped class. If the ...

How can I know if such value exists in database? (ADO.NET)

For example, I have a table, and there is a column named Tags . I want to know if value programming exists in this column. How can I do this in ADO.NET? I did this: OleDbCommand cmd = new ...

Convert date to string upon saving a doctrine record

I m trying to migrate one of my PHP projects to Doctrine. I ve never used it before so there are a few things I don t understand. In my current code, I have a class similar to this: class ...

热门标签