App Engine 앱은 기본적으로 동일한 프로젝트의 Datastore 모드 데이터베이스에 액세스할 수 있습니다. 각 App Engine 앱은 App Engine 기본 서비스 계정을 사용하여 Firestore와 같은 Google Cloud서비스에 대한 액세스를 관리합니다. 기본적으로 App Engine 기본 서비스 계정에는 프로젝트 편집자 IAM 역할이 있으며, 이 역할에는 Datastore 모드에 대한 전체 읽기 및 쓰기 액세스 권한이 있습니다.
App Engine 기본 서비스 계정을 사용 중지하거나 삭제하면 App Engine 앱은 Datastore 모드 데이터베이스에 대한 액세스 권한을 상실합니다.
App Engine 서비스 계정을 사용 중지한 경우 다시 사용 설정할 수 있습니다. 서비스 계정 사용 설정을 참조하세요.
지난 30일 내에 App Engine 서비스 계정을 삭제한 경우, 서비스 계정을 복원할 수 있습니다. 서비스 계정 삭제 취소를 참조하세요.
Compute Engine 인스턴스에서 데이터베이스에 액세스
이 섹션에서는 새 프로젝트 또는 기존 프로젝트의 Compute Engine VM 인스턴스에서 Datastore 모드 데이터베이스를 활성화하고 액세스하는 방법을 설명합니다.
Compute Engine용 Datastore 모드 권한
Compute Engine 앱은 기본적으로 동일한 프로젝트의 Datastore 모드 데이터베이스에 액세스할 수 있습니다. 각 Compute Engine 앱은 Compute Engine 기본 서비스 계정을 사용하여 Firestore와 같은 Google Cloud 서비스에 대한 액세스를 관리합니다. 기본적으로 Compute Engine 기본 서비스 계정에는 프로젝트 편집자 IAM 역할이 있으며, 이 역할에는 Datastore 모드에 대한 전체 읽기 및 쓰기 액세스 권한이 있습니다.
Compute Engine 인스턴스에서 데이터베이스에 액세스하려면 다음 단계를 완료하세요.
ID 및 API 액세스 섹션에서 액세스 범위를 설정하여 Datastore에 대한 액세스 권한을 제공합니다. 모든 Cloud APIs에 대한 전체 액세스 허용을 클릭하여 모든 Google Cloud API에 대한 액세스 권한을 부여하거나 각 API에 액세스 설정을 클릭하고 Datastore 드롭다운을 클릭한 다음 사용 설정됨을 클릭하여 Datastore에 대한 액세스 권한을 부여합니다.
가격 및 할당량에 설명된 대로 일정량의 무료 할당량을 이용할 수 있습니다. 즉, 결제를 사용 설정하지 않아도 Datastore 모드의 Firestore를 시작하거나 무료 할당량 한도까지 사용할 수 있습니다. 하지만 무료 할당량에서 제공하는 것보다 많은 리소스가 필요한 경우에는 결제를 사용 설정해야 합니다.
[[["이해하기 쉬움","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-05(UTC)"],[[["\u003cp\u003eThis document explains how to access a Firestore in Datastore mode database from various platforms, including App Engine, Compute Engine, and external applications.\u003c/p\u003e\n"],["\u003cp\u003eApp Engine apps can access a Datastore mode database in the same project by default, using the App Engine default service account which has Project Editor IAM role.\u003c/p\u003e\n"],["\u003cp\u003eCompute Engine apps also have default access to a Datastore mode database within the same project, leveraging the Compute Engine default service account and its Project Editor IAM role.\u003c/p\u003e\n"],["\u003cp\u003eAccessing the database from an external platform requires the creation of a service account with appropriate permissions, such as the Cloud Datastore User role, and a JSON key file for authentication.\u003c/p\u003e\n"],["\u003cp\u003eWhile a free quota is available for Firestore in Datastore mode, enabling billing is necessary for using more resources than provided by this free quota.\u003c/p\u003e\n"]]],[],null,["# Access your database\n\nThis page describes how to access a Firestore in Datastore mode database from different\nplatforms.\n\nBefore you begin\n----------------\n\nThis document assumes that you've already created a Datastore mode database.\nIf you haven't created a database, follow the instructions in the [Firestore in Datastore mode\nQuickstart](/datastore/docs/store-query-data).\n\nAccess your database from App Engine\n------------------------------------\n\nTo get started with Datastore mode and App Engine, see one of the\nfollowing language-specific pages:\n\n### Datastore mode permissions for App Engine\n\nApp Engine apps can access a Datastore mode database in the same\nproject by default. Each App Engine app uses an [App Engine default service\naccount](/appengine/docs/standard/python/service-account) to manage access to Google Cloud\nservices such as Firestore. By default, the App Engine default\nservice account has the Project Editor [IAM role](/iam/docs/overview#roles),\nwhich includes full read and write access to Datastore mode.\n\nYou can [modify the IAM permissions of your App Engine default service\naccount](/appengine/docs/standard/python/service-account#changing_service_account_permissions_),\nbut your app might lose access to Firestore unless you assign an IAM role\nwith the [required Firestore\npermissions](/datastore/docs/access/iam#required_permissions). The [Datastore Owner](/datastore/docs/access/iam#iam_roles) and [Datastore User](/datastore/docs/access/iam#iam_roles) IAM roles, for\nexample, grant read and write access to Firestore in Datastore mode.\n\nIf you disable or delete your App Engine default service account, your\nApp Engine app will lose access to your Datastore mode database.\nIf you disabled your App Engine service account, you can re-enable it,\nsee [enabling a service account](https://cloud.google.com/iam/docs/creating-managing-service-accounts#enabling).\nIf you deleted your App Engine service account within the last 30 days,\nyou can restore your service account, see\n[undeleting a service account](https://cloud.google.com/iam/docs/creating-managing-service-accounts#undeleting).\n\nAccess your database from a Compute Engine instance\n---------------------------------------------------\n\nThis section shows how to activate and access a Datastore mode\ndatabase from a [Compute Engine](/compute) VM instance in a new or existing project.\n\n### Datastore mode permissions for Compute Engine\n\nCompute Engine apps can access a Datastore mode database in the same\nproject by default. Each Compute Engine app uses an [Compute Engine default service\naccount](/compute/docs/access/service-accounts#default_service_account) to manage access to Google Cloud services such as\nFirestore. By default, the Compute Engine default service account has\nthe Project Editor [IAM role](/iam/docs/overview#roles), which\nincludes full read and write access to Datastore mode.\n\nTo access your database from a Compute Engine instance, complete the following steps:\n\n1. Enable the Google Compute Engine API for your project. \n [Enable the Compute Engine API](https://console.cloud.google.com/flows/enableapi?apiid=compute.googleapis.com)\n2.\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n3. Create a Compute Engine instance.\n\n### Console\n\n1. In the Google Cloud console, go to the [**VM Instances**](https://console.cloud.google.com/compute/instances) page.\n2. Click the **Create instance** button.\n3. In the **Identity and API access** section, set **Access scopes** to provide access for Datastore. Either click **Allow full access to all Cloud APIs** to grant access to all Google Cloud APIs, or click **Set access for each API** , click the dropdown for **Datastore** , and then click **Enabled** to grant access to Datastore.\n4. Click the **Create** button to create the VM instance.\n5. Confirm that your [instance is running](/compute/docs/instances/checking-instance-status).\n6. To use this new Compute Engine VM instance, [connect](/compute/docs/instances/connecting-to-instance) to it using your browser.\n\n### gcloud\n\n1. If you haven't already done this, [install](/sdk/docs/install) the Google Cloud CLI and [set up `gcloud compute`](/compute/docs/gcloud-compute).\n2. Add a Compute Engine VM instance and start it, following the instructions for\n [starting an instance](/compute/docs/instances/creating-and-starting-an-instance#startinstancegcloud)\n in the Compute Engine documentation. Specify the project ID, the\n VM instance name, and either the `cloud-platform` or the `datastore`\n [scope](/compute/docs/access/service-accounts#accesscopesiam)\n as shown in the following example.\n\n export PROJECT_ID=[YOUR_PROJECT_ID]\n export INSTANCE_NAME=[YOUR_INSTANCE_NAME]\n gcloud compute instances create $INSTANCE_NAME --project $PROJECT_ID --scopes datastore\n\n Replace `[YOUR_PROJECT_ID]` with the ID of the project you created\n previously and `[YOUR_INSTANCE_NAME]` with the name you want\n to use for your VM instance.\n3. Confirm that your [instance is running](/compute/docs/instances/checking-instance-status).\n\n4. To use this new VM instance, [connect](/compute/docs/instances/connecting-to-instance)\n to the VM.\n\nAt this point all services and authorizations are configured for your\nproject and you can start [writing code](/datastore/docs/datastore-api-tutorial) or [exploring the API](https://developers.google.com/apis-explorer/#search/datastore/).\n\nAccess your database from another platform\n------------------------------------------\n\nThis section shows how to access your Datastore mode database from\nan external application running on a platform outside of Google Cloud.\n\nFirst, create a service account:\n\n1. In the Google Cloud console, go to the **Create service account** page.\n\n [Go to Create service account](https://console.cloud.google.com/projectselector/iam-admin/serviceaccounts/create?supportedpurview=project)\n2. Select a project.\n\n3. In the **Service account name** field, enter a name. The\n Google Cloud console fills in the **Service account ID** field based on this\n name.\n\n4. Optional: In the **Service account description** field, enter a description.\n\n5. Click **Create**.\n\n6. Click the **Select a role** field.\n\n Under **All roles** , select a role that grants access to your database, such\n as **Datastore** \\\u003e **Cloud Datastore User**.\n7. Click **Continue**.\n\n8. Click **Done** to finish creating the service account.\n\n Do not close your browser window. You will use it in the next procedure.\n\nThen create a service account key:\n\n1. In the Google Cloud console, click the email address for the service account that you created.\n2. Click **Keys**.\n3. Click **Add key** , then **Create new key**.\n4. Click **Create**. A JSON key file is downloaded to your computer.\n5. Click **Close**.\n\nUse this service account to configure credentials for your application code as\ndescribed in [Providing service account credentials](/docs/authentication/production#providing_service_account_credentials).\n\nQuotas and billing\n------------------\n\nA certain amount of free quota is available, as described in\n[Pricing and Quota](/datastore/docs/pricing). This means you aren't required to\nenable billing to get started or to use Firestore in Datastore mode up to the free\nquota limits. However, if you need more resources than is provided by the free\nquota, you must enable billing.\n\nWhat's next\n-----------\n\n- Learn about [setting up authentication with client libraries](/datastore/docs/reference/libraries#setting_up_authentication).\n- Understand the [how your credentials are used by client libraries](/docs/authentication#adc).\n\nTo enable billing, see\n[Enable billing for a project](/billing/docs/how-to/modify-project#enable_billing_for_a_project)."]]