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 868485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:08:50+00:00 2026-05-15T10:08:50+00:00

Should I care about locality of entities on the Google App Engine datastore? Should

  • 0

Should I care about locality of entities on the Google App Engine datastore?
Should I use custom entity key names for that?

For example, I could use “$article_uuid,$comment_id” as the key name of a Comment entity.
Will it improve the speed of fetching all comments for an article?
Or is it better to use shorter keys?

Is it a good practice to use the key in this way?
I could use the “$article_uuid,$comment_id” key name also instead of an index:

def get_comments(article_uuid, limit=1000):
    key_prefix=db.Key.from_path('Comment', article_uuid)
    q = Comment.gql("where __key__ > :key_prefix and __key__ < :range_end",
        key_prefix=key_prefix, range_end=key_prefix+chr(ord(',')+1))
    return q.fetch(limit)
  • 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-05-15T10:08:50+00:00Added an answer on May 15, 2026 at 10:08 am

    The locality of your data will be improved with your key_name scheme (ref, see slide 40) – since your key_name is prefixed with the corresponding article’s ID, comments for a given article should be stored near each other.

    The key_name you proposed doesn’t seem like it would be too long. I don’t think you’ll see too much difference between that and shorter keys in terms of storage space or serialization/deserialization time. I expect that the size of the Comment entity will be dominated by the rest of the entity.

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

Sidebar

Related Questions

I have the feeling that I should not care about thread safe accessing /
I understand that users using Maven should not care about dependencies as Maven will
Are there any big differences a developer should care about?
I'm writing an Account module which should take care of everything about accounts: registration,
Does C static inline function have identity at runtime? Should I care about naming
Hello I want to know what all I should take care about for memory
When I save some binary data on disk (or memory), I should care about
I read somewhere that when creating a HTML email, you should use the table-based
I am required to use the mvvm pattern. I know that the viewmodel should
Should timestamps always use UTC (as in 2012-06-14T10:32:11+00:00 ) and not local time (as

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.