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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:04:20+00:00 2026-06-17T13:04:20+00:00

Why aren’t entities of the same kind implicitly in the same entity group when

  • 0

Why aren’t entities of the same kind implicitly in the same entity group when they don’t have a parent (they are root entities)? Does that mean if I want to do for example batch operations of writing data from MySQL to HRD:

db.put([Person(name=person.name) for person in cursor.execute("SELECT * FROM person")])

and I have to use transaction for this reason:

Note: A batch call to db.put() or db.delete() may succeed for some entities but not others. If it is important that the call succeed completely or fail completely, you must use a transaction, and all affected entities must be in the same entity group.

Source: https://developers.google.com/appengine/docs/python/datastore/entities#Batch_Operations

I need to create a common root parent key, which does not exists as a real entity only for the purpose of transaction?

parent_key = db.Key.from_path('Human', 'human')
db.put([Person(parent=parent_key, name=person.name) for person in cursor.execute("SELECT * FROM person")])
  • 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-17T13:04:21+00:00Added an answer on June 17, 2026 at 1:04 pm

    Entities of the same kind are not implicitly in the same entity group because it would generally give terrible performance for the majority of use cases.

    While not entirely accurate, you can think of entity groups as a way to control sharding. Entities in the same group are stored in close physical proximity (ie on the same server), allowing all entities to be operated on transactionally, but also limiting performance on that entity group. Parent relationships within entity groups are not restricted to kind, parent entities need not be in the same kind as children.

    Most of the time, entity groups would contain various entities of different kinds, which logically belong together because transactions tend to be based on the group. For example an Account might be the parent of a bunch of Transactions, or a BlogPost might be the parent of a bunch of Comments.

    Putting all entities of a Kind under the same parent would prevent them from being properly parented for other operations where they really need to be in transactions.

    In your case, it’s probably better not to run the operation in a transaction, and have extra code to handle failure cases.

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

Sidebar

Related Questions

I have a bunch of tests that aren't unit or functional tests, they're of
I have some OpenCL kernels that aren't doing what they should be, and I
Aren't Javascript blocks supposed to execute in the order that they are placed on
It seems that spinlocks aren't that great as they waste CPU cycles when the
The numbers themselves aren't relevant. I have a list of variables that are used
Why aren't C1 and c2 have the same hashcode ? the code doesn't get
Why aren't they const? I believe that's flawed API design. Or am I missing
Why aren't my results being filtered by the members from my [Group Hierarchy] returned
It now makes sense that the versions aren't right. I know I am using
What are some key bindings that aren't included?

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.