将实体放入Google App Engine数据存储区后无法立即使用

My application has a flow as the followings:-

  1. User enters New Entity Page.
  2. User hits save button, the system puts the new entity into Datastore.
  3. The system redirects the user immediately to Edit page.
  4. Edit page makes a query for the newly just inserted entity.
  5. (Problem) newly inserted entity sometimes were not available.

I think it is because Datastore needs to do some data replication therefore the newly inserted data will not be available immediately after the Put(..) function returned. What should I do with the problem or do I need to use transaction?

You should read about eventual consistency: https://cloud.google.com/appengine/docs/go/datastore/structuring_for_strong_consistency

You could make an ancestor query or you could try to refer to the newly created entity by key.