java - Complexity of a query in the Google datastore -
i have android app users able send private messages each other. (for instance: sends message b , c , 3 of them may comment message)
i use google app engine , google datastore java. (framework objectify) have created member
entity , message
entity contains arraylist<string>
field, representing recipients'ids list. (that key field of member
entity)
in order user messages 1 of recipients, planning on loading each message
entity on datastore , select them checking if arraylist<string>
field contains user's id. however, considering there may hundred of thousands messages stored, wondering if possible , if wouldn't take time?
the time fetch results datastore relates number of entities retrieved, not total number of entities stored because every query must use index. that's makes datastore scalable.
you have limit number of messages retrieved per call , use cursor fetch next batch. can send cursor on android client converting websafe string, client can indicate starting point next request.
Comments
Post a Comment