سؤال

So I have a question about designing a datastore database, I'm using objectify. I'm trying to get optimal performance.

So I need to create two entities, List and Listings, with a relationship. There will be 500,000 listings in all and 50,000 per list. Looking at this https://code.google.com/p/objectify-appengine/wiki/IntroductionToObjectify#Multi-Value_Relationship

I see there are three methods to store relationship.

One to one, many to one and Multi-value relationship.

The Multi-Value relationship looks like it would work great but appears to have a limit of 5,000 entries per entity(List?)

So I assume I should use the many to one method but I question the performance on this as I would have to query every listing and filter.

Can I have good performance doing what I'm attempting with datastore?

Any help at all would be great!

هل كانت مفيدة؟

المحلول

Multi-value relationship in that case has no a good performance because each value implies a new line on its field index. It means longer write times. Also it has a limit of entries. It's useful when you have a few values to store.

There is another type of relationship: entity group.

The criteria to choose between each method also depends on the type of queries you do and the frequency of updating entities.

In base of the information you provide, I recommend many-to-one relationship.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top