Go 1.11은 지원이 종료되었으며 2026년 1월 31일에
지원 중단됩니다. 지원 중단 후에는 조직에서 이전에 조직 정책을 사용하여 레거시 런타임의 배포를 다시 사용 설정한 경우에도 Go 1.11 애플리케이션을 배포할 수 없습니다. 기존 Go 1.11 애플리케이션은
지원 중단 날짜 이후에도 계속 실행되고 트래픽을 수신합니다.
지원되는 최신 Go 버전으로 마이그레이션하는 것이 좋습니다.
Datastore 쿼리의 데이터 일관성
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
데이터 일관성 레벨
Datastore 쿼리는 두 가지 일관성 레벨 중 하나로 결과를 제공합니다.
Eventual Consistency를 가진 쿼리에서는 결과를 수집하는 데 사용되는 색인에 액세스할 때도 eventual consistency가 적용됩니다. 결과적으로 이러한 쿼리는 원래의 기준에 더 이상 일치하지 않는 항목을 반환하는 경우가 있는 반면 strong consistency를 가진 쿼리는 항상 트랜잭션에서 일관적입니다.
Datastore 쿼리 데이터 일관성
쿼리는 각각의 특성에 따라 다양한 레벨의 일관성을 보장하는 결과를 반환합니다.
- 상위 쿼리(항목 그룹 내 쿼리)는 기본적으로 strong consistency를 갖지만 Datastore 읽기 정책을 설정하여 eventual consistency를 갖도록 구성할 수 있습니다(아래 참조).
- 상위 쿼리가 아닌 쿼리는 항상 eventual consistency를 가집니다.
키를 사용하여 항목을 가져오는 '키별 조회'라는 방식은 강력한 일관성을 갖습니다.
다음 단계
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-09-04(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eThis 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+.\u003c/p\u003e\n"],["\u003cp\u003eDatastore 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.\u003c/p\u003e\n"],["\u003cp\u003eAncestor queries are strongly consistent by default but can be made eventually consistent, whereas non-ancestor queries are always eventually consistent.\u003c/p\u003e\n"],["\u003cp\u003eFetching an entity by key is a strongly consistent operation.\u003c/p\u003e\n"],["\u003cp\u003eFurther learning resources are available on specifying query returns, restrictions, cursors, and the basic syntax of Datastore queries.\u003c/p\u003e\n"]]],[],null,["# Data Consistency in Datastore Queries\n\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| go\n| /services/access). If you are updating to the App Engine Go 1.12+ runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/go-differences) to learn about your migration options for legacy bundled services.\n\nData consistency levels\n-----------------------\n\nDatastore queries can deliver their results at either of two consistency\nlevels:\n\n- [*Strongly consistent*](https://en.wikipedia.org/wiki/Strong_consistency) queries guarantee the freshest results, but may take longer to complete.\n- [*Eventually consistent*](https://en.wikipedia.org/wiki/Eventual_consistency) queries generally run faster, but may occasionally return stale results.\n\nIn 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.\n\nDatastore query data consistency\n--------------------------------\n\nQueries return their results with different levels of consistency guarantee, depending on the nature of the query:\n\n- [Ancestor queries](/appengine/docs/legacy/standard/go111/datastore/queries#ancestor_queries) (those within an [entity group](./#Go_Ancestor_paths) ) are strongly consistent by default, but can instead be made eventually consistent by setting the Datastore read policy (see below).\n- Non-ancestor queries are always eventually consistent.\n\nFetching an entity by key, which is also called \"lookup by key\", is strongly\nconsistent.\n\nWhat's next?\n------------\n\n- [Learn how to specify what a query returns and further control query results](/appengine/docs/legacy/standard/go111/datastore/retrieving-query-results).\n- Learn the [common restrictions](/appengine/docs/legacy/standard/go111/datastore/query-restrictions) for queries on Datastore.\n- Learn about [query cursors](/appengine/docs/legacy/standard/go111/datastore/query-cursors), which allow an application to retrieve a query's results in convenient batches.\n- Learn the [basic syntax and structure of queries](/appengine/docs/legacy/standard/go111/datastore/queries) for Datastore."]]