Google Datastore Query Complexity

I have an Android app where users can send private messages to each other. (for example: A sends a message to B and C, and three of them can comment on this message)

I use the Google engine for Google and the Google data store using Java. (Objectify framework) I created a Member object and a Message object that contains an ArrayList<String> field representing a list of recipients. (i.e. the key field of the Member object)

So that the user can receive all messages in which he is one of the recipients, I planned to upload each Message object to the data store and then select them, checking if the ArrayList<String> field contains the user ID, However, given that one hundred thousand can be stored Messages, I was wondering if this is possible, and if it does not take too much time?

+6
source share
1 answer

The time to retrieve the results from the data warehouse refers only to the number of objects received, and not to the total number of entities stored, because each query MUST use an index. This is what makes storage so scalable.

You will need to limit the number of messages received per call and use Cursor to receive the next batch. You can send the cursor to the Android client by moving it to the websafe line so that the client can specify the starting point for the next request.

+1
source

Source: https://habr.com/ru/post/987275/


All Articles