有这样的数据库吗? [英] Is there a database like this?

查看:114
本文介绍了有这样的数据库吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景:好的,所以我在寻找我猜是一个对象数据库。然而,我所看到的(确实很少)对象数据库是简单的持久层,而不是成熟的DBMS。我不知道如果我正在寻找甚至被认为是一个对象数据库,所以真的任何帮助指向我正确的方向将非常感激。

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.

我不想给你两个页面描述我正在寻找什么,所以我将用一个例子来说明我的观点。假设我有一个BlogPost对象,我需要存储。类似这样的伪代码:

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.)

现在,在关系数据库中, author 将被存储为指向 User.id ,并且标签注释多对多或多对多关系,使用单独的表来存储关系。我想要的是一个数据库引擎,执行以下操作:

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:


  • 存储相关对象( author 标签等),而不是使用外键,这需要额外的查找;

  • 允许我在博客帖子中添加评论或标签,而不检索整个对象,对其进行更新,

  • 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)

我猜是什么,然后把它放回到数据库中(像一个面向文档的数据库 - m寻找是一个导航数据库,但我不知道。有什么东西,甚至远远类似于我在想什么?如果是,它叫什么?

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?

只是为了澄清,我不是在寻找一个ORM 或一个抽象层或类似的东西。我正在寻找一个实际的数据库在内部。对不起,如果我困难,但我已经搜索,我找不到任何东西。

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.

此外,JVM的东西会很好,但在这一点上我真的不在乎它运行的平台。

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

推荐答案

我认为你所描述的内容很容易在 图表数据库 。然后,您可以得到导航到您想要更改的节点/边缘的好处,而无需检索任何其他内容。对于JVM,有 Neo4j 开源图表数据库(我是团队的一员)。您可以在高可扩展性中阅读,作为概述的一部分 thinkvitamin 或在此堆栈溢出线程。至于标签,我认为将它们存储在图形数据库可以给你一些额外的优势,如果你想找到相关的标签和类似的东西。只需在邮寄名单上添加一行,我相信社群会帮助你。

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.

这篇关于有这样的数据库吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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