Google Appengine NDB ancestor vs key query

后端 未结 1 1653
北恋
北恋 2021-01-02 06:34

I am storing a key of an entity as a property of another in order to relate them. We are in a refactor stage at this point in the project so I was thinking about introducing

相关标签:
1条回答
  • 2021-01-02 06:57

    The ancestor query will always be fully consistent. Querying by book_key, on the other hand, will not necessarily be consistent: you may find that recent changes will not be shown in that query.

    On the other hand, introducing an ancestor imposes a limit on the number of updates: you can only do one update per second to any entity group (ie the ancestor and its children).

    It's a trade-off for you as to which one is more important in your app.

    0 讨论(0)
提交回复
热议问题