Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

The BigTable design rejects many of the philosophies of standard relational models, explicitly preferring denormalization to a big host of tiny tables.

One of the larger areas where this is a problem is in the modelling of many to many joins.

One way to model these joins is to violate first normal form, and put all interesting data in a db.ListProperty(). While this has the ability to be searchable from a query, I have not yet explored the performance implications of searching a list versus pulling another table.

As joins are not possible, it is possible to link tables through RelationshipProperties. Therefore, with enough effort, the standard intersection table (a table with a joint primary key which references both parent tables) can be created. Has anyone explored the performance hits of the various implementations?

-Edit-

While the List of Keys suggested in the documentation is indeed one way to do it, I'm interested in the performance and anomaly rates of that and other implementations. Is there utility in creating mutual lists of keys? Is the effort involved in the repeated gets worth the price? Is there a better way to do it?

share|improve this question
add comment

2 Answers

In my experience on GAE, you should use table queries sparingly. Adding a "join" table would just slow things down even more. For example, if you have tables A and B which share a many-to-many relationship, and you create a "join" table J with RelationshipProperty fields to both A and B, you will have to query J every time you want to find related records (entities).

It would be much faster to have the List of Keys in A or B (or both if necessary) because they will be included when you fetch that record/entity. As long as you don't have too many keys in the list (that is, the entity isn't too large), this is the way to go.

I've started using ndb on my applications and there are some significant benefits to using keys when fetching entities. If the entity is already cached, it will pull it from memory or memcache first. So if there is significant overlap in your Lists of Keys, the fetches will be much faster for those entities already fetched.

share|improve this answer
add comment

I'm also working with the GAE datastore right now, you should check this article if you haven't already. If you have found something useful, please update your question.

EDIT:

I found this today, check it out.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.