Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8715469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:51:08+00:00 2026-06-13T05:51:08+00:00

I asked another question about doing large queries in GAE, to which the answer

  • 0

I asked another question about doing large queries in GAE, to which the answer was pretty much not possible.

What I want to do is this: from an iOS device, I get all the user’s contacts phone numbers. So now I have a list of say 250 phone numbers. I want to send these phone numbers back to the server and check to see which of these phone numbers belong to a User account.

So I need to do a query: query = User.query(User.phone.IN(phones_list))

However, with GAE, this is quite an expensive query. It will cost 250 reads for just this one query, and I expect to do this type of query often.

So I came up with a crazy idea. Why don’t I host the phone numbers on another host, on another database, where this type of query is cheaper. Then I can have GAE send a HTTP request to my other server to get the desired info.

So I have two questions:

  1. Are there any databases more streamlined to handle these kinds of
    queries, and which it would be more cheaper to do? Or will it all be
    the same as GAE?
  2. Is this overkill? Is it a good idea? Should I suck it up and pay the cost?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:51:10+00:00Added an answer on June 13, 2026 at 5:51 am

    GAE’s datastore should be good enough for your service. Since your application looks like could be parallelized very well.

    1. use phone number as key_name of User.

    As you set number as key_name of User, the following code will increase the query speed and reduce the read operation.

    memcache.get_multi([phone_number1, phone_number2 ... ])
    db.get([number1_not_found_in_memcache, number2_not_found_in_memcache])
    
    memcache.set_multi("all_number_found_in_db")
    

    2. store multi number in one datastore.

    the operation cost of GAE not directly related to the entity’s size. therefore a large entity store multi data would be another way to save the operation cost.

    for example, store several phone number which have the same number_prefix together.

    class Number(db.Model):
        number_prefix = db.StringProperty()
        numbers = db.StringListProperty(indexed = False)
    
    # check number 01234567, 032123124
    numbers = Number.get(["01", "03'])
    
    # check 01234567 in number[0].numbers ?
    # check 032123124 in number[1].numbers ?
    

    this method could further imporve with memcache.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I asked another SOAP related question some time ago, which asks for a working
I just asked another question about pascal triangle about finding sum of 1500th row.
Another question asked about the meaning of the code snippet a >>> 0 in
Another question asked about attributes, but I would like to extend the question to
I asked this question yesterday got a pretty good answer but can't figure out
I asked a question earlier about which language to use for an AI prototype.
I already asked a question about this yesterday, but now I have another :)
I asked another question about HTML and PHP separation as I have seen references
I asked another question about custom AlertDialog here . Then I clicked my way
I asked a question about callbacks and arrived at another question (see comment). How

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.