数据库替代方案?

发布于 2024-08-11 16:41:50 字数 61 浏览 6 评论 0原文

我想知道使用数据库的权衡以及其他选择是什么?另外,哪些问题不适合数据库?

我关心关系数据库。

I was wondering the trade-offs for using databases and what the other options were? Also, what problems are not well suited for databases?

I'm concerned with Relational Databases.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

┊风居住的梦幻卍 2024-08-18 16:41:51

这是一个相当广泛的问题,但数据库非常适合管理关系数据。替代方案几乎总是意味着设计自己的数据存储和检索引擎,这对于大多数标准/小型应用程序来说是不值得的。

不太适合数据库的典型场景是存储大量数据,这些数据被组织为相对少量的逻辑文件,在这种情况下,一个简单的类似文件系统的系统就足够了。

This is a rather broad question, but databases are well suited for managing relational data. Alternatives would almost always imply to design your own data storage and retrieval engine, which for most standard/small applications is not worth the effort.

A typical scenario that is not well suited for a database is the storage of large amounts of data which are organized as a relatively small amount of logical files, in this case a simple filesystem-like system can be enough.

情定在深秋 2024-08-18 16:41:51

不要忘记查看一下 NOSQL 数据库。这是一项相当新的技术,非常适合关系数据库中不适合/无法扩展的内容。

Don't forget to take a look at NOSQL databases. It's pretty new technology and well suited for stuff that doesn't fit/scale in a relational database.

为你鎻心 2024-08-18 16:41:51

如果您有数据要存储和查询,请使用数据库。

从技术上讲,大多数东西都适合数据库。计算机是用来处理数据的,数据库是用来存储数据的。

唯一需要考虑的是成本。部署成本、维护成本、时间投入,但通常都是值得的。

如果您只需要存储非常简单的数据,平面文件将是一个替代方案(文本文件)。

注意:您使用了通用术语“数据库”,但它们有许多不同的类型和实现。

Use a database if you have data to store and query.

Technically, most things are suited for databases. Computers are made to process data and databases are made to store them.

The only thing to consider is cost. Cost of deployment, cost of maintenance, time investment, but it will usually be worth it.

If you only need to store very simple data, flat files would be an alternative (text files).

Note: you used the generic term 'database', but there are many many different types and implementations of these.

逆流 2024-08-18 16:41:51
  • 对于搜索应用程序全文搜索引擎(其中一些集成到传统的 DBMS,但其中一些则没有) ,可能是一个很好的选择,它允许更多的功能(各种语言感知、半结构化数据的能力、排名......)以及更好的性能。

  • 此外,我还见过一些应用程序将配置数据存储在数据库中,虽然这在某些情况下是有意义的,但使用纯文本文件< /strong>(或 YAML、XML 等)并在初始化期间加载底层对象可能更可取,因为这种替代方案具有自包含的性质,并且易于修改和复制此类文件。

  • 平面日志文件可以是记录到 DBMS 的一个很好的替代方案,当然具体取决于使用情况。

也就是说,在过去 10 年左右的时间里,DBMS 系统总体上添加了许多功能,以帮助它们处理不同形式的数据和不同的搜索功能(例如:前面提到的全文搜索、XML、智能存储/处理BLOB、强大的用户定义函数等)这使得它们更加通用,因此是一项相当普遍的服务。 然而,他们的优势仍然主要在于关系数据

  • For search applications, full-text search engines (some of which are integrated to traditional DBMSes, but some of which are not), can be a good alternative, allowing both more features (various linguistic awareness, ability to have semi-structured data, ranking...) as well as better performance.

  • Also, I've seen applications where configuration data is stored in the database, and while this makes sense in some cases, using plain text files (or YAML, XML and such) and loading the underlying objects during initialization, may be preferable, due to the self-contained nature of such alternative, and to the ease of modifying and replicating such files.

  • A flat log file, can be a good alternative to logging to DBMS, depending on usage of course.

This said, in the last 10 years or so, the DBMS Systems, in general, have added many features, to help them handle different forms of data and different search capabilities (ex: FullText search a fore mentioned, XML, Smart storage/handling of BLOBs, powerful user-defined functions, etc.) which render them more versatile, and hence a fairly ubiquitous service. Their strength remain mainly with relational data however.

旧话新听 2024-08-18 16:41:50

数据库的概念非常广泛。我将对我在这里介绍的内容进行一些简化。

对于某些任务,最常见的数据库是关系数据库。它是一个基于关系模型的数据库。关系模型假设您按行描述数据,这些数据属于表,其中每个表都有给定且固定的列数。您以“每行”为基础提交数据,这意味着您必须在单个镜头中提供一行,其中包含与表中所有列相关的数据。每个提交的行通常都会获得一个标识符,该标识符在表级别(有时在数据库级别)是唯一的。您可以在关系数据库中的实体之间创建关系,例如,表中的给定单元格必须引用另一个表的行,以便保留所谓的“引用完整性”。

该模型运行良好,但它并不是唯一的模型。在某些情况下,数据可以更好地组织为树。文件系统是一个分层数据库。从根开始,一切都在这个根下,形成树状结构。另一个模型是键/值对。 Sleepycat BDB 基本上是键/值实体的存储。

LDAP 是另一个数据库,它有两个优点:存储相当通用的数据,按设计进行分布式,并且针对读取进行了优化。

图数据库和三元组存储允许您存储图并执行同构搜索。如果您有一个非常通用的数据集,可以包含对实体的广泛描述(如此广泛以至于基本上是未知的),那么通常需要这样做。这与关系模型明显相反,在关系模型中,您使用一组非常精确的列创建表,并且您知道每列将包含什么。

还存在一些基于列的关系数据库。您不是按行提交数据,而是按整列提交数据。

所以,回答你的问题:数据库是一种存储数据的方法。从技术上讲,即使文本文件也是一个数据库,尽管不是一个特别好的数据库。数据库背后模型的选择主要与应用程序的典型需求相关。

将答案设置为 CW,因为我可能说的是严格不正确的事情。请随意编辑。

The concept of database is very broad. I will make some simplifications in what I present here.

For some tasks, the most common database is the relational database. It's a database based on the relational model. The relational model assumes that you describe your data in rows, belonging to tables where each table has a given and fixed number of columns. You submit data on a "per row" basis, meaning that you have to provide a row in a single shot containing the data relative to all columns of your table. Every submitted row normally gets an identifier which is unique at the table level, sometimes at the database level. You can create relationships between entities in the relational database, for example by saying that a given cell in your table must refer to another table's row, so to preserve the so called "referential integrity".

This model works fine, but it's not the only one out there. In some cases, data are better organized as a tree. The filesystem is a hierarchical database. starts at a root, and everything goes under this root, in a tree like structure. Another model is the key/value pair. Sleepycat BDB is basically a store of key/value entities.

LDAP is another database which has two advantages: stores rather generic data, it's distributed by design, and it's optimized for reading.

Graph databases and triplestores allow you to store a graph and perform isomorphism search. This is typically needed if you have a very generic dataset that can encompass a broad level of description of your entities, so broad that is basically unknown. This is in clear opposition to the relational model, where you create your tables with a very precise set of columns, and you know what each column is going to contain.

Some relational column-based databases exist as well. Instead of submitting data by row, you submit them by whole column.

So, to answer your question: a database is a method to store data. Technically, even a text file is a database, although not a particularly nice one. The choice of the model behind your database is mostly relative to what is the typical needs of your application.

Setting the answer as CW as I am probably saying something strictly not correct. Feel free to edit.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文