|
| 1 | +--- |
| 2 | +title: "Firestore" |
| 3 | +type: docs |
| 4 | +weight: 1 |
| 5 | +description: > |
| 6 | + Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development. It's a fully managed, serverless database that supports mobile, web, and server development. |
| 7 | +
|
| 8 | +--- |
| 9 | + |
| 10 | +# Firestore Source |
| 11 | + |
| 12 | +[Firestore][firestore-docs] is a NoSQL document database built for automatic |
| 13 | +scaling, high performance, and ease of application development. While the |
| 14 | +Firestore interface has many of the same features as traditional databases, |
| 15 | +as a NoSQL database it differs from them in the way it describes relationships |
| 16 | +between data objects. |
| 17 | + |
| 18 | +If you are new to Firestore, you can [create a database and learn the |
| 19 | +basics][firestore-quickstart]. |
| 20 | + |
| 21 | +[firestore-docs]: https://cloud.google.com/firestore/docs |
| 22 | +[firestore-quickstart]: https://cloud.google.com/firestore/docs/quickstart-servers |
| 23 | + |
| 24 | +## Requirements |
| 25 | + |
| 26 | +### IAM Permissions |
| 27 | + |
| 28 | +Firestore uses [Identity and Access Management (IAM)][iam-overview] to control |
| 29 | +user and group access to Firestore resources. Toolbox will use your [Application |
| 30 | +Default Credentials (ADC)][adc] to authorize and authenticate when interacting |
| 31 | +with [Firestore][firestore-docs]. |
| 32 | + |
| 33 | +In addition to [setting the ADC for your server][set-adc], you need to ensure |
| 34 | +the IAM identity has been given the correct IAM permissions for accessing |
| 35 | +Firestore. Common roles include: |
| 36 | +- `roles/datastore.user` - Read and write access to Firestore |
| 37 | +- `roles/datastore.viewer` - Read-only access to Firestore |
| 38 | + |
| 39 | +See [Firestore access control][firestore-iam] for more information on |
| 40 | +applying IAM permissions and roles to an identity. |
| 41 | + |
| 42 | +[iam-overview]: https://cloud.google.com/firestore/docs/security/iam |
| 43 | +[adc]: https://cloud.google.com/docs/authentication#adc |
| 44 | +[set-adc]: https://cloud.google.com/docs/authentication/provide-credentials-adc |
| 45 | +[firestore-iam]: https://cloud.google.com/firestore/docs/security/iam |
| 46 | + |
| 47 | +### Database Selection |
| 48 | + |
| 49 | +Firestore allows you to create multiple databases within a single project. Each |
| 50 | +database is isolated from the others and has its own set of documents and |
| 51 | +collections. If you don't specify a database in your configuration, the default |
| 52 | +database named `(default)` will be used. |
| 53 | + |
| 54 | +## Example |
| 55 | + |
| 56 | +```yaml |
| 57 | +sources: |
| 58 | + my-firestore-source: |
| 59 | + kind: "firestore" |
| 60 | + project: "my-project-id" |
| 61 | + # database: "my-database" # Optional, defaults to "(default)" |
| 62 | +``` |
| 63 | + |
| 64 | +## Reference |
| 65 | + |
| 66 | +| **field** | **type** | **required** | **description** | |
| 67 | +|-----------|:--------:|:------------:|----------------------------------------------------------------------------------------------------------| |
| 68 | +| kind | string | true | Must be "firestore". | |
| 69 | +| project | string | true | Id of the GCP project that contains the Firestore database (e.g. "my-project-id"). | |
| 70 | +| database | string | false | Name of the Firestore database to connect to. Defaults to "(default)" if not specified. | |
0 commit comments