Go 1.11 has reached end of support
and will be
deprecated
on January 31, 2026. After deprecation, you won't be able to deploy Go 1.11
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Go
1.11 applications will continue to run and receive traffic after their
deprecation date. We
recommend that you
migrate to the latest supported version of Go.
Data Consistency in Datastore Queries
Stay organized with collections
Save and categorize content based on your preferences.
Data consistency levels
Datastore queries can deliver their results at either of two consistency
levels:
In an eventually consistent query, the indexes used to gather the results are also accessed with eventual consistency. Consequently, such queries may sometimes return entities that no longer match the original query criteria, while strongly consistent queries are always transactionally consistent.
Datastore query data consistency
Queries return their results with different levels of consistency guarantee, depending on the nature of the query:
- Ancestor queries (those within an
entity group
)
are strongly consistent by default, but can instead be made eventually
consistent by setting the Datastore read policy (see below).
- Non-ancestor queries are always eventually consistent.
Fetching an entity by key, which is also called "lookup by key", is strongly
consistent.
What's next?
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["This API supports first-generation runtimes and is relevant when upgrading to corresponding second-generation runtimes, with a migration guide available for those updating to App Engine Go 1.12+."],["Datastore queries have two consistency levels: strongly consistent queries, which provide the freshest results but may take longer, and eventually consistent queries, which are faster but may return stale results."],["Ancestor queries are strongly consistent by default but can be made eventually consistent, whereas non-ancestor queries are always eventually consistent."],["Fetching an entity by key is a strongly consistent operation."],["Further learning resources are available on specifying query returns, restrictions, cursors, and the basic syntax of Datastore queries."]]],[]]