有这样的数据库吗?

发布于 2024-07-25 08:02:26 字数 1071 浏览 14 评论 0原文

背景:好的,所以我正在寻找我认为是对象数据库的东西。 然而,我所研究的(诚然少数)对象数据库都是简单的持久层,而不是成熟的 DBMS。 我不知道我正在寻找的内容是否被认为是对象数据库,所以任何帮助我指明正确方向的帮助都将非常感激。


我不想给您两页来描述我正在寻找的内容,因此我将使用一个示例来说明我的观点。 假设我有一个需要存储的“BlogPost”对象。 像这样的伪代码:(

class BlogPost
    title:String
    body:String
    author:User
    tags:List<String>
    comments:List<Comment>

假设 Comment 是它自己的类。)

现在,在关系数据库中,author 将存储为指向 的外键>User.idtagscomments 将使用单独的表存储为一对多或多对多关系的关系。 我想要的是一个执行以下操作的数据库引擎:

  • 使用直接引用存储相关对象(authortags 等),而不是使用外键,这需要额外查找; 换句话说,数据库本身应该支持彼此之上的对象
  • 允许我向博客文章添加评论或标签,而无需检索整个对象,更新它,然后将其放回数据库(就像面向文档的数据库——CouchDB 就是一个例子)

我想我正在寻找的是一个导航数据库,但我不知道。 有什么与我的想法有一点相似的吗? 如果是的话,它叫什么? (或者更好的是,给我一个实际的工作数据库。)或者我太挑剔了?


编辑:

只是澄清一下,我不是在寻找 ORM 或抽象层或类似的东西。 我正在寻找一个在内部执行此操作的实际数据库。 抱歉,如果我太难了,但我已经搜索过,但找不到任何东西。


编辑:

此外,针对 JVM 的一些东西会很棒,但此时我真的不关心它在什么平台上运行。

Background: Okay, so I'm looking for what I guess is an object database. However, the (admittedly few) object databases that I've looked at have been simple persistence layers, and not full-blown DBMSs. I don't know if what I'm looking for is even considered an object database, so really any help in pointing me in the right direction would be very appreciated.


I don't want to give you two pages describing what I'm looking for so I'll use an example to illustrate my point. Let's say I have a "BlogPost" object that I need to store. Something like this, in pseudocode:

class BlogPost
    title:String
    body:String
    author:User
    tags:List<String>
    comments:List<Comment>

(Assume Comment is its own class.)

Now, in a relational database, author would be stored as a foreign key pointing to a User.id, and the tags and comments would be stored as one-to-many or many-to-many relationships using a separate table to store the relationships. What I'd like is a database engine that does the following:

  • Stores related objects (author, tags, etc.) with a direct reference instead of using foreign keys, which require an additional lookup; in other words, objects on top of each other should be natively supported by the database
  • Allows me to add a comment or a tag to the blog post without retrieving the entire object, updating it, and then putting it back into the database (like a document-oriented database -- CouchDB being an example)

I guess what I'm looking for is a navigational database, but I don't know. Is there anything even remotely similar to what I'm thinking of? If so, what is it called? (Or better yet, give me an actual working database.) Or am I being too picky?


Edit:

Just to clarify, I am NOT looking for an ORM or an abstraction layer or anything like that. I am looking for an actual database that does this internally. Sorry if I'm being difficult, but I've searched and I couldn't find anything.


Edit:

Also, something for the JVM would be excellent, but at this point I really don't care what platform it runs on.

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

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

发布评论

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

评论(11

枯寂 2024-08-01 08:02:26

我认为您所描述的内容可以轻松地在 图形数据库。 然后,您可以导航到要进行更改的节点/边缘,而无需检索其他任何内容。 对于 JVM,有 Neo4j 开源图形数据库(我是该团队的一员)。 您可以在 高可扩展性 中阅读相关内容,作为概述的一部分: thinkvitamin 或在 此 stackoverflow 线程。 至于标签,我认为如果您想查找相关标签和类似的内容,将它们存储在图形数据库中可以给您带来一些额外的优势。 只需在邮件列表上写一行,然后我相信社区会帮助你。

I think what you are describing could easily be modeled in a graph database. Then you get the benefit of navigating to the nodes/edges where you want to make changes without any need to retrieve anything else. For the JVM there's the Neo4j open source graph database (where I'm part of the team). You can read about it over at High Scalability, as part of an overview at thinkvitamin or in this stackoverflow thread. As for the tags, I think storing them in a graph database can give you some extra advantages if you want to find related tags and similar stuff. Just drop a line on the mailing list, and I'm sure the community will help you out.

一口甜 2024-08-01 08:02:26

您可以尝试使用 C# 和 Java 版本的 db4o

You could try out db4o which is available in C# and Java.

淡写薰衣草的香 2024-08-01 08:02:26

我想我们正在寻找这个:http://www.odbms.org/。 这个网站有一些关于对象数据库的好信息,包括 Objectivity,这是一个非常好的对象数据库。

I think our looking for this: http://www.odbms.org/. This site has some good info on Object Databases, including Objectivity, which is a pretty good object database.

杀手六號 2024-08-01 08:02:26

正是您所描述的可以通过在普通 RDBMS 上运行的 (N)Hibernate 来完成。

将这样的持久层与普通数据库一起使用的优点是您拥有一个标准的数据库系统并结合了方便的编程。 您以非常自然的方式声明您的类,并且 (N)Hibernate 提供了一种在引用/列表和外键关系之间进行转换的方法。

Java 教程: http://docs.jboss .org/hibernate/stable/core/reference/en/html/tutorial-firstapp.html

.NET 教程:https://web.archive.org/web/20081212181310/ http://blogs.hibernatingrhinos.com/nhibernate/archive/2008/04/01/your-first-nhibernate-based-application.aspx

如果您坚持认为不想使用支持良好的标准 RDBMS,并且宁愿将您的数据信任为更奇特且测试较少的东西,您正在寻找 对象关系数据库

然而,无论如何,这样的产品最好的实现方式可能是使其成为标准 RDBMS 之上的一层。 这可能就是为什么像 (N)Hibernate 这样的 ORM 是最流行的解决方案——它们允许应用标准 RDBMS 软件(以及广泛可用的管理/用户技能),而且编程体验 99% 是基于对象的。

Exactly what you've described can be done with (N)Hibernate running on an ordinary RDBMS.

The advantage of using such a persistence layer with an ordinary database is that you have a standard database system combined with convenient programming. You declare your classes in a very natural way, and (N)Hibernate provides a way to translate betweeen references/lists and foreign key relationships.

Java tutorial: http://docs.jboss.org/hibernate/stable/core/reference/en/html/tutorial-firstapp.html

.NET tutorial: https://web.archive.org/web/20081212181310/http://blogs.hibernatingrhinos.com/nhibernate/archive/2008/04/01/your-first-nhibernate-based-application.aspx

If you insist that you don't want to use a well-supported standard RDBMS and would rather trust your data to something more exotic and less heavily tested, you're looking for an Object Relational Database.

However, such a product would probably be best implemented by making it be a layer over a standard RDBMS anyway. This is probably why ORMs like (N)Hibernate are the most popular solution - they allow standard RDBMS software (and widely available management/user skills) to be applied, and yet the programming experience is 99% object-based.

So要识趣 2024-08-01 08:02:26

这正是 LINQ 的设计目的。

Microsoft LINQ 定义了一组专有查询运算符,可用于查询、投影和筛选数组、可枚举类、XML (XLINQ)、关系数据库和第三方数据源中的数据。 虽然它允许查询任何数据源,但它要求将数据封装为对象。 因此,如果数据源本身不将数据存储为对象,则必须将数据映射到对象域。 使用查询运算符编写的查询要么由 LINQ 查询处理引擎执行,要么通过扩展机制移交给 LINQ 提供程序,LINQ 提供程序要么实现单独的查询处理引擎,要么转换为不同的格式以在单独的数据存储上执行(例如在数据库服务器上作为 SQL 查询 (DLINQ))。 查询结果作为内存中对象的集合返回,这些对象可以使用标准迭代器函数(例如 C# 的 foreach)进行枚举。

This is exactly what LINQ was designed for.

Microsoft LINQ defines a set of proprietary query operators that can be used to query, project and filter data in arrays, enumerable classes, XML (XLINQ), relational database, and third party data sources. While it allows any data source to be queried, it requires that the data be encapsulated as objects. So, if the data source does not natively store data as objects, the data must be mapped to the object domain. Queries written using the query operators are executed either by the LINQ query processing engine or, via an extension mechanism, handed over to LINQ providers which either implement a separate query processing engine or translate to a different format to be executed on a separate data store (such as on a database server as SQL queries (DLINQ)). The results of a query are returned as a collection of in-memory objects that can be enumerated using a standard iterator function such as C#'s foreach.

喵星人汪星人 2024-08-01 08:02:26

有各种各样的术语,都链接到对象关系映射,又名 ORM,它可能是您查找的最有用的一个。 许多编程语言都存在 ORM 库。

There's a variety of terms, all linked to Object-Relational Mapping, aka ORM, which is probably going to be the most useful one for you to look up. ORM libraries exist for many programming languages.

暗地喜欢 2024-08-01 08:02:26

Oracle 的 嵌套表 提供了该功能的一部分,尽管在更新中,您不能只添加嵌套表的一行 - 您必须替换整个嵌套表。

Oracle's nested tables provide some part of that functionality, though in updates, you cannot just add a row to the nested table - you have to replace the whole nested table.

蛮可爱 2024-08-01 08:02:26

我猜您正在寻找具有“EntityFirst”方法的 ORM。

在 EntityFirst 方法中,开发人员最不关心数据库。 您只需要构建您的实体或对象。 然后,ORM 负责将实体存储在数据库中并根据您的意愿检索它们。

据我所知,唯一的 EntityFirst ORM“Signum”。 这是一个构建在 .net 之上的出色框架。 我建议您观看 SignumFramework 网站上的一些视频,然后我相信你会发现它很有用。

链接文本:http://www.signumframework.com

谢谢。

I guess you're looking for an ORM with "EntityFirst" approach.

In EntityFirst approach the developer is least[not-at-all] concerned with Database. You just have to build your entities or objects. The ORM then takes care of storing the entities in Database and retrieving them at your will.

The only EntityFirst ORM witihn my knowledge "Signum". It's a wonderful framework built on top of .net. I recommend you to go thrgouh some videos on the SignumFramework website and I'm sure you'll find it useful.

Link Text: http://www.signumframework.com

Thanks.

深爱成瘾 2024-08-01 08:02:26

也许是 ZODB?
很好的介绍在这里找到:
http://www.ibm.com/developerworks/aix/library/au -zodb/

ZODB perhaps?
good introduction find here:
http://www.ibm.com/developerworks/aix/library/au-zodb/

地狱即天堂 2024-08-01 08:02:26

您可以尝试 STSdb、DB4O、Perst ...,它们可用于 C# 和 Java。

You could try out STSdb, DB4O, Perst ... which is available in C# and Java.

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