English 中文(简体)
Is there a nosql store that also allows for relationships between stored entities?
原标题:

I am looking for nosql key value stores that also provide for storing/maintaining relationships between stored entities. I know Google App Engine s datastore allows for owned and unowned relationships between entities. Does any of the popular nosql store s provide something similar?

Even though most of them are schema less, are there methods to appropriate relationships onto a key value store?

最佳回答

It belongs to the core features of graph databases to provide support for relationships between entities. Typically, you model your entities as nodes and the relationships as relationships/edges in the graph. Unlike RDBMS you don t have to define relationships in advance -- just add them to the graph as needed (schema-free). I created a domain modeling gallery giving a few examples of how this can look in practice. The examples use the Neo4j graphdb, a project I m involved in. The mailing list of this project use to prove very helpful for graph modeling questions.

The document-oriented database Riak has support for links between documents.

You can add support for relationships on top of any database engine (like key/value), but it doesn t come whithout work. It all comes down to your use case. If you provide more details it s easier to come up with a useful answer.

Oops, now I saw that the title says "nosql store" and then your actual question narrows this down to "nosql key value store". As key/value stores have no semantics for defining relationships between entities I ll still post my answer.

问题回答

MongoDB is a document database, not a key/value store. It does provide, however, a simple form of inter-document references. These work more-or-less like SQL foreign keys that are automatically nulled when the referenced object is deleted.

This is adequate for the same sorts of things for which you d use foreign keys, but it isn t optimized for serious graph traversal.

The relationships in the Google App Engine are only keys to entities that are automatically de-referenced when accessed in code. And are only values when used to filter against. Its a function of the DB Api rather than anything explicit, so the access to the ReferenceProperty will simply perform a query against the referenced model to get access to the object.

If you look at something like MongoDB, the relationships are stored in-object (from what I remeber), but they can also be stored however you want in the sense that you would create an API that would search the joined table for your item in the relationship in a similar manner to who the App Engine works.

Paul.





相关问题
How to make logging.debug work on Appengine?

I m having a tough time getting the logging on Appengine working. the statement import logging is flagged as an unrecognized import in my PyDev Appengine project. I suspected that this was just an ...

gqlQuery returns object, want list of keys

Is there a way to convert the GqlQuery object to an array of keys, or is there a way to force the query to return an array of keys? For example: items = db.GqlQuery("SELECT __key__ FROM Items") ...

Integrating Google AppEngine with a Thick Client

I want to make a multi-user client-server solution with Java Swing thick client as a front-end and Google AppEngine (Java one) as a back-end. The problem is that GAE provides only web-based forms for ...

sorl.thumbnail : thumbnail is not a valid tag library?

I am trying to install sorl.thumbnail but am getting the following error message: thumbnail is not a valid tag library: Could not load template library from django.templatetags.thumbnail, No module ...

热门标签