I have been hired to help write an application that manages certain information for the end user. It is intended to manage a few megabytes of information, but also manage scanned images in full resolution. Should this project use a database, and why or why not?
我被聘请帮助编写一个管理最终用户某些信息的应用程序。它旨在管理几兆字节的信息,但也以全分辨率管理扫描图像。该项目是否应该使用数据库,为什么或为什么不使用?
11 个解决方案
#1
1
Any question "Should I use a certain tool?" comes down to asking exactly what you want to do. You should ask yourself - "Do I want to write my own storage for this data?"
有任何问题“我应该使用某种工具吗?”归结为确切地询问你想做什么。您应该问自己 - “我想为这些数据编写自己的存储空间吗?”
Most web based applications are written against a database because most databases support many "free" features - you can have multiple webservers. You can use standard tools to edit, verify and backup your data. You can have a robust storage solution with transactions.
大多数基于Web的应用程序是针对数据库编写的,因为大多数数据库都支持许多“免费”功能 - 您可以拥有多个Web服务器。您可以使用标准工具来编辑,验证和备份数据。您可以拥有一个包含事务的强大存储解决方案
#2
1
The database won't help you much in dealing with the image data itself, but anything that manages a bunch of images is going to have meta-data about the images that you'll be dealing with. Depending on the meta-data and what you want to do with it, a database can be quite helpful indeed with that.
数据库对处理图像数据本身没什么帮助,但管理一堆图像的任何东西都会有关于你要处理的图像的元数据。根据元数据和您想要用它做什么,数据库确实非常有用。
And just because the database doesn't help you much with the image data, that doesn't mean you can't store the images in the database. You would store them in a BLOB column of a SQL database.
仅仅因为数据库对图像数据没有多大帮助,这并不意味着您无法将图像存储在数据库中。您可以将它们存储在SQL数据库的BLOB列中。
#3
1
If the amount of data is small, or installed on many client machines, you might not want the overhead of a database.
如果数据量很小,或者安装在许多客户端计算机上,您可能不需要数据库的开销。
Is it intended to be installed on many users machines? Adding the overhead of ensuring you can run whatever database engine you choose on a client installed app is not optimal. Since the amount of data is small, I think XML would be adequate here. You could Base64 encode the images and store them as CDATA.
是否打算在许多用户机器上安装?添加确保您可以运行在客户端安装的应用程序上选择的任何数据库引擎的开销并不是最佳选择。由于数据量很小,我认为XML就足够了。您可以对图像进行Base64编码并将其存储为CDATA。
Will the application be run on a server? If you have concurrent users, then databases have concepts for handling these scenarios (transactions), and that can be helpful. And the scanned image data would be appropriate for a BLOB.
应用程序是否可以在服务器上运行?如果您有并发用户,那么数据库具有处理这些方案(事务)的概念,这可能会有所帮助。并且扫描的图像数据适合于BLOB。
#4
1
You shouldn't store images in the database, as is the general consensus here.
您不应将图像存储在数据库中,这是此处的一般共识。
The file system is just much better at storing images than your database is.
文件系统在存储图像方面要比数据库好得多。
You should use a database to store meta information about those images, such as a title, description, etc, and just store a URL or path to the images.
您应该使用数据库来存储有关这些图像的元信息,例如标题,描述等,并且只存储图像的URL或路径。
#5
1
When it comes to storing images in a database I try to avoid it. In your case from what I can gather of your question there is a possibilty for a subsantial number of fairly large images, so I would probably strong oppose it.
在将数据存储到数据库中时,我尽量避免使用它。在你的情况下我可以收集你的问题,有可能存在大量相当大的图像,所以我可能强烈反对它。
If this is a web application I would use a database for quick searching and indexing of images using keywords and other parameters. Then have a column pointing to the location of the image in a filesystem if possible with some kind of folder structure to help further decrease the image load time.
如果这是一个Web应用程序,我将使用数据库使用关键字和其他参数快速搜索和索引图像。然后在文件系统中有一个指向图像位置的列,如果可能的话,使用某种文件夹结构来帮助进一步减少图像加载时间。
If you need greater security due to the directory being available (network share) and the application is local then you should probably bite the bullet and store the images in the database.
如果由于目录可用(网络共享)而需要更高的安全性且应用程序是本地的,那么您应该咬住子弹并将图像存储在数据库中。
#6
0
My gut reaction is "why not?" A database is going to provide a framework for storing information, with all of the input/output/optimization functions provided in a documented format. You can go with a server-side solution, or a local database such as SQLite or the local version of SQL Server. Either way you have a robust, documented data management framework.
我的直觉反应是“为什么不呢?”数据库将提供一个存储信息的框架,所有输入/输出/优化功能都以文档格式提供。您可以使用服务器端解决方案,也可以使用本地数据库(如SQLite)或本地版本的SQL Server。无论哪种方式,您都拥有一个强大的文档化数据管理框架。
#7
0
This post should give you most of the opinions you need about storing images in the database. Do you also mean 'should I use a database for the other information?' or are you just asking about the images?
这篇文章应该为您提供有关在数据库中存储图像所需的大部分意见。你还的意思是“我应该使用数据库来获取其他信息吗?”或者你只是询问图像?
#8
0
A database is meant to manage large volumes of data, and are supposed to give you fast access to read and write that data in spite of the size. Put simply, they manage scale for data - scale that you don't want to deal with. If you have only a few users (hundreds?), you could just as easily manage the data on disk (say XML?) and keep the data in memory. The images should clearly not go in to the database so the question is how much data, or for how many users are you maintaining this database instance?
数据库用于管理大量数据,并且可以让您快速访问,无论大小如何,都可以读取和写入数据。简而言之,他们管理数据规模 - 您不想处理的规模。如果您只有几个用户(数百?),您可以轻松管理磁盘上的数据(比如XML?)并将数据保存在内存中。图像应该显然不会进入数据库,因此问题是您维护此数据库实例的数据量或用户数量是多少?
#9
0
If you want to have a structured way to store and retrieve information, a database is most definitely the way to go. It makes your application flexible and more powerful, and lets you focus on the actual application rather than incidentals like trying to write your own storage system.
如果您想要一种结构化的方式来存储和检索信息,那么数据库绝对是最佳选择。它使您的应用程序更灵活,功能更强大,让您专注于实际的应用程序,而不是像编写自己的存储系统那样的偶然事件。
For individual applications, SQLite is great. It fits right in an app as a file; no need for a whole DRBMS juggernaut.
对于个人应用程序,SQLite很棒。它适合作为文件的应用程序;不需要整个DRBMS的主宰。
#10
0
There are a lot of factors to this. But, being a database weenie, I would err on the side of having a database. It just makes life easier when things changes. and things will change.
这有很多因素。但是,作为一个数据库weenie,我会错误地拥有一个数据库。当事情发生变化时,它会让生活更轻松。事情会改变。
Depending on the images, you might store them on the file system or actually blob them and put them in the database (Not supported in all DBMS's). If the files are very small, then I would blob them. If they are big, then I would keep them on he file system and manage them yourself.
根据图像,您可以将它们存储在文件系统上或实际将它们填充并将它们放入数据库中(不是所有DBMS都支持)。如果文件非常小,那么我会把它们包起来。如果它们很大,那么我会将它们保存在文件系统上并自行管理它们。
There are so many free or cheap DBMS's out there that there really is no excuse not to use one. I'm a SQL Server guy, but f your application is that simple, then the free version of mysql should do the job. In fact, it has some pretty cool stuff in there.
有那么多免费或廉价的DBMS,没有理由不使用它。我是一个SQL Server的人,但你的应用程序就是那么简单,那么免费版的mysql应该可以胜任。事实上,它有一些非常酷的东西。
#11
0
Our CMS stores all of the check images we process. It uses a database for metadata and lets the file system handle the scanned images.
我们的CMS存储了我们处理的所有支票图像。它使用数据库作为元数据,并让文件系统处理扫描的图像。
A simple database like SQLite sounds appropriate - it will let you store file metadata in a consistent, transactional way. Then store the path to each image in the database and let the file system do what it does best - manage files.
像SQLite这样的简单数据库听起来很合适 - 它可以让您以一致的事务方式存储文件元数据。然后将路径存储到数据库中的每个映像,让文件系统执行它最擅长的操作 - 管理文件。
SQL Server 2008 has a new data type built for in-database files, but before that BLOB was the way to store files inside the database. On a small scale that would work too.
SQL Server 2008具有为数据库内文件构建的新数据类型,但在此之前BLOB是在数据库中存储文件的方法。在一个小规模,也会工作。
#1
1
Any question "Should I use a certain tool?" comes down to asking exactly what you want to do. You should ask yourself - "Do I want to write my own storage for this data?"
有任何问题“我应该使用某种工具吗?”归结为确切地询问你想做什么。您应该问自己 - “我想为这些数据编写自己的存储空间吗?”
Most web based applications are written against a database because most databases support many "free" features - you can have multiple webservers. You can use standard tools to edit, verify and backup your data. You can have a robust storage solution with transactions.
大多数基于Web的应用程序是针对数据库编写的,因为大多数数据库都支持许多“免费”功能 - 您可以拥有多个Web服务器。您可以使用标准工具来编辑,验证和备份数据。您可以拥有一个包含事务的强大存储解决方案
#2
1
The database won't help you much in dealing with the image data itself, but anything that manages a bunch of images is going to have meta-data about the images that you'll be dealing with. Depending on the meta-data and what you want to do with it, a database can be quite helpful indeed with that.
数据库对处理图像数据本身没什么帮助,但管理一堆图像的任何东西都会有关于你要处理的图像的元数据。根据元数据和您想要用它做什么,数据库确实非常有用。
And just because the database doesn't help you much with the image data, that doesn't mean you can't store the images in the database. You would store them in a BLOB column of a SQL database.
仅仅因为数据库对图像数据没有多大帮助,这并不意味着您无法将图像存储在数据库中。您可以将它们存储在SQL数据库的BLOB列中。
#3
1
If the amount of data is small, or installed on many client machines, you might not want the overhead of a database.
如果数据量很小,或者安装在许多客户端计算机上,您可能不需要数据库的开销。
Is it intended to be installed on many users machines? Adding the overhead of ensuring you can run whatever database engine you choose on a client installed app is not optimal. Since the amount of data is small, I think XML would be adequate here. You could Base64 encode the images and store them as CDATA.
是否打算在许多用户机器上安装?添加确保您可以运行在客户端安装的应用程序上选择的任何数据库引擎的开销并不是最佳选择。由于数据量很小,我认为XML就足够了。您可以对图像进行Base64编码并将其存储为CDATA。
Will the application be run on a server? If you have concurrent users, then databases have concepts for handling these scenarios (transactions), and that can be helpful. And the scanned image data would be appropriate for a BLOB.
应用程序是否可以在服务器上运行?如果您有并发用户,那么数据库具有处理这些方案(事务)的概念,这可能会有所帮助。并且扫描的图像数据适合于BLOB。
#4
1
You shouldn't store images in the database, as is the general consensus here.
您不应将图像存储在数据库中,这是此处的一般共识。
The file system is just much better at storing images than your database is.
文件系统在存储图像方面要比数据库好得多。
You should use a database to store meta information about those images, such as a title, description, etc, and just store a URL or path to the images.
您应该使用数据库来存储有关这些图像的元信息,例如标题,描述等,并且只存储图像的URL或路径。
#5
1
When it comes to storing images in a database I try to avoid it. In your case from what I can gather of your question there is a possibilty for a subsantial number of fairly large images, so I would probably strong oppose it.
在将数据存储到数据库中时,我尽量避免使用它。在你的情况下我可以收集你的问题,有可能存在大量相当大的图像,所以我可能强烈反对它。
If this is a web application I would use a database for quick searching and indexing of images using keywords and other parameters. Then have a column pointing to the location of the image in a filesystem if possible with some kind of folder structure to help further decrease the image load time.
如果这是一个Web应用程序,我将使用数据库使用关键字和其他参数快速搜索和索引图像。然后在文件系统中有一个指向图像位置的列,如果可能的话,使用某种文件夹结构来帮助进一步减少图像加载时间。
If you need greater security due to the directory being available (network share) and the application is local then you should probably bite the bullet and store the images in the database.
如果由于目录可用(网络共享)而需要更高的安全性且应用程序是本地的,那么您应该咬住子弹并将图像存储在数据库中。
#6
0
My gut reaction is "why not?" A database is going to provide a framework for storing information, with all of the input/output/optimization functions provided in a documented format. You can go with a server-side solution, or a local database such as SQLite or the local version of SQL Server. Either way you have a robust, documented data management framework.
我的直觉反应是“为什么不呢?”数据库将提供一个存储信息的框架,所有输入/输出/优化功能都以文档格式提供。您可以使用服务器端解决方案,也可以使用本地数据库(如SQLite)或本地版本的SQL Server。无论哪种方式,您都拥有一个强大的文档化数据管理框架。
#7
0
This post should give you most of the opinions you need about storing images in the database. Do you also mean 'should I use a database for the other information?' or are you just asking about the images?
这篇文章应该为您提供有关在数据库中存储图像所需的大部分意见。你还的意思是“我应该使用数据库来获取其他信息吗?”或者你只是询问图像?
#8
0
A database is meant to manage large volumes of data, and are supposed to give you fast access to read and write that data in spite of the size. Put simply, they manage scale for data - scale that you don't want to deal with. If you have only a few users (hundreds?), you could just as easily manage the data on disk (say XML?) and keep the data in memory. The images should clearly not go in to the database so the question is how much data, or for how many users are you maintaining this database instance?
数据库用于管理大量数据,并且可以让您快速访问,无论大小如何,都可以读取和写入数据。简而言之,他们管理数据规模 - 您不想处理的规模。如果您只有几个用户(数百?),您可以轻松管理磁盘上的数据(比如XML?)并将数据保存在内存中。图像应该显然不会进入数据库,因此问题是您维护此数据库实例的数据量或用户数量是多少?
#9
0
If you want to have a structured way to store and retrieve information, a database is most definitely the way to go. It makes your application flexible and more powerful, and lets you focus on the actual application rather than incidentals like trying to write your own storage system.
如果您想要一种结构化的方式来存储和检索信息,那么数据库绝对是最佳选择。它使您的应用程序更灵活,功能更强大,让您专注于实际的应用程序,而不是像编写自己的存储系统那样的偶然事件。
For individual applications, SQLite is great. It fits right in an app as a file; no need for a whole DRBMS juggernaut.
对于个人应用程序,SQLite很棒。它适合作为文件的应用程序;不需要整个DRBMS的主宰。
#10
0
There are a lot of factors to this. But, being a database weenie, I would err on the side of having a database. It just makes life easier when things changes. and things will change.
这有很多因素。但是,作为一个数据库weenie,我会错误地拥有一个数据库。当事情发生变化时,它会让生活更轻松。事情会改变。
Depending on the images, you might store them on the file system or actually blob them and put them in the database (Not supported in all DBMS's). If the files are very small, then I would blob them. If they are big, then I would keep them on he file system and manage them yourself.
根据图像,您可以将它们存储在文件系统上或实际将它们填充并将它们放入数据库中(不是所有DBMS都支持)。如果文件非常小,那么我会把它们包起来。如果它们很大,那么我会将它们保存在文件系统上并自行管理它们。
There are so many free or cheap DBMS's out there that there really is no excuse not to use one. I'm a SQL Server guy, but f your application is that simple, then the free version of mysql should do the job. In fact, it has some pretty cool stuff in there.
有那么多免费或廉价的DBMS,没有理由不使用它。我是一个SQL Server的人,但你的应用程序就是那么简单,那么免费版的mysql应该可以胜任。事实上,它有一些非常酷的东西。
#11
0
Our CMS stores all of the check images we process. It uses a database for metadata and lets the file system handle the scanned images.
我们的CMS存储了我们处理的所有支票图像。它使用数据库作为元数据,并让文件系统处理扫描的图像。
A simple database like SQLite sounds appropriate - it will let you store file metadata in a consistent, transactional way. Then store the path to each image in the database and let the file system do what it does best - manage files.
像SQLite这样的简单数据库听起来很合适 - 它可以让您以一致的事务方式存储文件元数据。然后将路径存储到数据库中的每个映像,让文件系统执行它最擅长的操作 - 管理文件。
SQL Server 2008 has a new data type built for in-database files, but before that BLOB was the way to store files inside the database. On a small scale that would work too.
SQL Server 2008具有为数据库内文件构建的新数据类型,但在此之前BLOB是在数据库中存储文件的方法。在一个小规模,也会工作。