Go 1.11은 지원이 종료되었으며 2026년 1월 31일에
지원 중단됩니다. 지원 중단 후에는 조직에서 이전에 조직 정책을 사용하여 레거시 런타임의 배포를 다시 사용 설정한 경우에도 Go 1.11 애플리케이션을 배포할 수 없습니다. 기존 Go 1.11 애플리케이션은
지원 중단 날짜 이후에도 계속 실행되고 트래픽을 수신합니다.
지원되는 최신 Go 버전으로 마이그레이션하는 것이 좋습니다.
Datastore 모드로 Cloud Firestore 사용
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Firestore는 자동 확장, 고성능, 간편한 애플리케이션 개발을 위해 설계된 NoSQL 문서 데이터베이스입니다. Datastore의 최신 버전이며 Datastore에 비해 여러 가지 부분이 개선되었습니다.
Datastore 모드의 Firestore는 서버 사용 사례 및 App Engine에 최적화되어 있으므로 App Engine 앱에서 주로 사용하는 데이터베이스에는 Datastore 모드의 Firestore를 사용하는 것이 좋습니다. 기본 모드의 Firestore는 모바일 및 실시간 알림 사용 사례에 가장 유용합니다. Firestore 모드에 대한 자세한 내용은 Native 모드와 Datastore 모드 중 선택을 참조하세요.
App Engine에서 Datastore 모드 사용
App Engine에서 Datastore 모드를 사용하려면 다음 안내를 따르세요.
아직 만들지 않았다면 데이터베이스를 만들고 Datastore 모드에서 Firestore를 선택합니다.
기존 Datastore 데이터베이스를 App Engine 앱에 사용할 수 있습니다. 이러한 기존 데이터베이스는 자동으로 Datastore 모드의 Firestore로 업그레이드됩니다.
앱에서 go get cloud.google.com/go/datastore
명령어를 사용하여 Datastore를 종속 항목으로 선언합니다. 또는 앱의 go.mod
파일에서 종속 항목을 선언할 수 있습니다. 종속 항목 지정에 대해 자세히 알아보세요.
Google Cloud 클라이언트 라이브러리를 사용하여 항목 읽기 및 쓰기와 데이터 쿼리를 수행합니다.
색인 구성
Datastore 모드는 애플리케이션에서 생성되는 모든 쿼리에 색인을 사용합니다. 이러한 색인은 항목이 변경될 때마다 업데이트되므로 앱이 쿼리를 생성할 때 결과가 신속하게 반환될 수 있습니다.
Datastore 모드는 단순 유형의 쿼리에 사용할 단일 속성 색인을 자동으로 생성합니다. 여러 속성이 포함된 복잡한 쿼리의 경우 앱의 index.yaml
파일에서 복합 색인을 구성해야 합니다.
App Engine 개발 서버는 테스트를 실행하는 데 필요한 복합 색인으로 index.yaml
파일을 업데이트합니다. 마찬가지로 테스트를 실행할 때 Datastore 모드 에뮬레이터가 색인을 생성할 수 있습니다.
로컬 테스트를 실행하지 않거나 테스트에 복잡한 쿼리가 포함되지 않은 경우 앱의 index.yaml
파일에 색인을 수동으로 추가할 수도 있습니다.
데이터베이스 권한 설정
기본적으로 앱에는Google Cloud 프로젝트에서 Datastore 모드와 Firestore 데이터베이스를 읽고 쓰는 데 필요한 권한이 모두 있습니다.
이러한 권한을 관리하기 위해 각 App Engine 앱은 앱과 동일한 프로젝트에서 Datastore 모드와 Firestore 데이터베이스에 대한 전체 읽기 및 쓰기 액세스 권한을 부여하는 기본 서비스 계정을 사용합니다. 기본 서비스 계정의 권한을 변경할 수는 있지만 필요한 권한이 있는 IAM 역할을 할당하지 않으면 앱에서 액세스 권한을 상실할 수 있습니다.
다른 사용자, 앱, 프로젝트에서 데이터베이스에 액세스하도록 허용하는 방법은 데이터베이스 액세스를 참조하세요.
로컬 테스트용 Datastore 모드 에뮬레이터 사용
Google Cloud CLI에는 프로덕션 Datastore 모드 환경의 로컬 에뮬레이터가 포함되어 있습니다.
에뮬레이터를 사용하여 로컬에서 애플리케이션을 개발하고 테스트할 수 있습니다. 또한 에뮬레이터를 사용하면 프로덕션 Datastore 모드 인스턴스의 색인을 생성하고 필요하지 않은 색인을 삭제할 수 있습니다.
앱을 테스트하는 데 App Engine 로컬 개발 서버를 사용할 경우 서버를 시작할 때 --support_datastore_emulator=true
플래그를 설정하여 서버가 Datastore 모드 에뮬레이터를 사용하도록 할 수 있습니다.
Datastore 모드 에뮬레이터를 사용하면 dev_appserver에 다음이 표시됩니다.
... Using Cloud Datastore Emulator.
가격 책정, 할당량, 한도
Datastore 모드는 일일 한도가 있는 무료 할당량을 제공합니다. 유료 계정은 스토리지, 읽기 및 쓰기 작업을 무제한으로 제공합니다. 자세한 내용은 Datastore 할당량 페이지를 참조하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 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\u003eFirestore, an upgraded version of Datastore, is a NoSQL document database designed for automatic scaling, high performance, and ease of application development.\u003c/p\u003e\n"],["\u003cp\u003eFirestore in Datastore mode is recommended for server-centric applications, particularly those on App Engine, while Native mode suits mobile and real-time notification use cases.\u003c/p\u003e\n"],["\u003cp\u003eApp Engine apps can leverage Datastore mode by declaring it as a dependency and using the Google Cloud Client Library for entity and data management.\u003c/p\u003e\n"],["\u003cp\u003eDatastore mode uses indexes for all queries, automatically creating single-property indexes and requiring the manual configuration of composite indexes in the \u003ccode\u003eindex.yaml\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eThe Datastore mode emulator, included with the Google Cloud CLI, facilitates local testing and development and can aid in generating necessary indexes.\u003c/p\u003e\n"]]],[],null,["# Using Cloud Firestore in Datastore Mode\n\nFirestore is a NoSQL document database built for automatic scaling,\nhigh performance, and ease of application development. It is the newest version\nof Datastore and introduces several improvements over\nDatastore.\n\nBecause Firestore in [Datastore mode](/datastore/docs)\nis optimized for server use cases and for\nApp Engine, we recommend using Firestore in\nDatastore mode for databases that will be used primarily by\nApp Engine apps. Firestore in Native mode is most useful for\nmobile and real-time notification use cases. For more information about\nFirestore modes, see [Choosing between Native Mode and\nDatastore mode](/datastore/docs/firestore-or-datastore).\n\nUsing Datastore mode with App Engine\n------------------------------------\n\nTo use Datastore mode with App Engine:\n\n1. If you haven't already done so,\n [create a database](/datastore/docs/store-query-data#create_a_database)\n and choose Firestore in Datastore mode.\n\n You can use existing Datastore databases with App Engine\n apps. These existing databases [will be automatically upgraded to\n Firestore in Datastore\n mode](/datastore/docs/upgrade-to-firestore).\n\n\n 1. In your app, declare Datastore as a dependency\n\n by using the `go get cloud.google.com/go/datastore` command. Alternatively,\n you can declare dependencies in your app's `go.mod` file. Learn more\n [about specifying dependencies](/appengine/docs/legacy/standard/go111/specifying-dependencies).\n\n \u003cbr /\u003e\n\n 2. Use the Google Cloud Client Library to\n [read and write entities](/datastore/docs/concepts/entities)\n and to [query data](/datastore/docs/concepts/queries).\n\n Configuring indexes\n -------------------\n\n Datastore mode uses\n [indexes](/datastore/docs/concepts/indexes)\n for every query your application makes. The indexes are updated whenever an\n entity changes, so the results can be returned quickly when the app makes a\n query.\n\n Datastore mode automatically creates single-property indexes for use with\n simple types of queries. For complex queries that include multiple properties,\n you'll need to configure composite indexes in your app's `index.yaml` file.\n\n The App Engine development server will update your `index.yaml` file\n with the composite indexes needed to run your tests. Similarly, the\n [Datastore mode emulator can generate indexes](/datastore/docs/tools)\n when you run tests.\n\n You can also add the indexes to your app's\n `index.yaml` file [manually](/appengine/docs/legacy/standard/go111/configuring-datastore-indexes-with-index-yaml) if you do not run local\n tests or your tests do not include complex queries.\n\n Setting database permissions\n ----------------------------\n\n By default, your app has all the permissions required to read and write to\n Datastore mode and Firestore databases in your\n Google Cloud project.\n\n To manage these permissions, each App Engine app uses a [default service\n account](/appengine/docs/legacy/standard/go111/service-account)\n that gives full read and write access to Datastore mode\n and Firestore databases in the same project as the app. You can\n [change the permissions of the default service\n account](/appengine/docs/legacy/standard/go111/access-control#modify-service-account),\n but your app may lose access unless you assign an IAM role with the\n [required permissions](/datastore/docs/access/iam#required_permissions).\n\n For information about allowing other users, apps, or projects to access a database, see\n [Accessing your database](/datastore/docs/activate).\n\n Using the Datastore mode emulator for local testing\n ---------------------------------------------------\n\n The Google Cloud CLI includes a local [emulator of the production Datastore mode\n mode environment](/datastore/docs/tools/datastore-emulator). You can use the emulator to develop and test your application locally. In addition, the emulator can help you generate indexes for your production Datastore mode mode instance and delete unneeded indexes.\n\n \u003cbr /\u003e\n\n If you use the App Engine [local development\n server](/appengine/docs/legacy/standard/python/tools/using-local-server) to test your\n app, you can ensure that the server will use the Datastore mode\n emulator by setting the `--support_datastore_emulator=true` flag when starting\n the server.\n\n If you are using the Datastore mode emulator, dev_appserver will display: \n\n ... Using Cloud Datastore Emulator.\n\n Pricing, quotas, and limits\n ---------------------------\n\n Datastore mode offers a free quota with daily limits. Paid\n accounts offer unlimited storage, read, and write operations. More information\n is available on the [Datastore Quotas](/appengine/docs/legacy/standard/go111/quotas#Datastore) page."]]