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 할당량 페이지를 참조하세요.
[[["이해하기 쉬움","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 is a NoSQL document database, with Datastore mode being optimized for server use cases and App Engine, while Native mode is better for mobile and real-time notifications.\u003c/p\u003e\n"],["\u003cp\u003eDatastore mode utilizes indexes for every query, automatically creating single-property indexes and requiring configuration of composite indexes for complex queries in the \u003ccode\u003eindex.yaml\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eApp Engine apps have a default service account with full read and write access to Datastore mode and Firestore databases within the same project, with permissions that can be modified but may affect app access.\u003c/p\u003e\n"],["\u003cp\u003eA local emulator is available via the Google Cloud CLI for developing and testing applications locally, which can also generate and manage indexes for the production environment.\u003c/p\u003e\n"],["\u003cp\u003eDatastore mode has a free quota with daily limits, while paid accounts have unlimited storage and operations.\u003c/p\u003e\n"]]],[],null,["# Using Cloud Firestore in Datastore Mode\n\nGo Java Node.js PHP Python Ruby\n\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\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)](/datastore/docs) is optimized for\nserver use cases and for App Engine, we recommend using\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\nConfiguring indexes\n-------------------\n\nDatastore mode uses\n[indexes](/datastore/docs/concepts/indexes)\nfor every query your application makes. The indexes are updated whenever an\nentity changes, so the results can be returned quickly when the app makes a\nquery.\n\nDatastore mode automatically creates single-property indexes for use with\nsimple types of queries. For complex queries that include multiple properties,\nyou'll need to configure composite indexes in your app's `index.yaml` file.\n\nThe App Engine development server will update your `index.yaml` file\nwith the composite indexes needed to run your tests. Similarly, the\n[Datastore mode emulator can generate indexes](/datastore/docs/tools)\nwhen you run tests.\n\nYou can also add the indexes to your app's\n`index.yaml` file [manually](/appengine/docs/standard/configuring-datastore-indexes-with-index-yaml)\nif you do not run local tests or your tests do not include complex queries.\n\nSetting database permissions\n----------------------------\n\nBy default, your app has all the permissions required to read and write to\nDatastore mode and Firestore databases in your\nGoogle Cloud project.\n\nTo manage these permissions, each App Engine app uses a [default service\naccount](/appengine/docs/standard/default-service-account)\nthat gives full read and write access to Datastore mode\nand Firestore databases in the same project as the app. You can\n[change the permissions of the default service\naccount](/appengine/docs/standard/access-control#modify-service-account),\nbut your app may lose access unless you assign an IAM role with the\n[required permissions](/datastore/docs/access/iam#required_permissions).\n\nFor information about allowing other users, apps, or projects to access a database, see\n[Accessing your database](/datastore/docs/activate).\n\nUsing the Datastore mode emulator for local testing\n---------------------------------------------------\n\n\u003cbr /\u003e\n\n\nThe Google Cloud CLI includes a local [emulator of the production Datastore mode\nmode environment](/datastore/docs/tools/datastore-emulator).\nYou can use the emulator to develop and test your application locally. In\naddition, the emulator can help you generate indexes for your production\nDatastore mode mode instance and delete unneeded indexes.\n\nIf you use the App Engine [local development\nserver](/appengine/docs/standard/python/tools/using-local-server) to test your\napp, you can ensure that the server will use the Datastore mode\nemulator by setting the `--support_datastore_emulator=true` flag when starting\nthe server.\n\nIf you are using the Datastore mode emulator, dev_appserver will display: \n\n ... Using Cloud Datastore Emulator.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPricing, quotas, and limits\n---------------------------\n\nDatastore mode offers a free quota with daily limits. Paid\naccounts offer unlimited storage, read, and write operations. More information\nis available on the [Datastore Quotas](/appengine/docs/standard/quotas#Datastore) page."]]