Skip to main content
Version: Preview

Firebase

Experimental
Creates:
AssetsLineage

Configure in the UI

This plugin can be configured directly in the Marmot UI with a step-by-step wizard.

View Guide

The Firebase plugin discovers the data stores in a Firebase project: Firestore databases with their collections and subcollections, and Realtime Database instances.

Firestore stores no schema, so each collection's fields are inferred from a sample of its documents. A field missing from any sampled document, or null in one, is marked nullable, and a field seen with two different types is recorded as mixed.

Cloud Storage for Firebase buckets are not discovered here. They are ordinary GCS buckets, and the Google Cloud Storage plugin already catalogues them under the same identity.

Subcollections

A Firestore subcollection lives under a document, so a lines subcollection under orders really exists once per order. Those copies share a shape, so the plugin catalogues them as one asset with the parent document id left out of the name: firestore/(default)/orders/lines. The fields are inferred from documents read across all the parent documents it sampled. The collection_group_id metadata field is the id a Firestore collection group query uses to reach every copy.

Databases

Leaving databases empty lists every Firestore database in the project through the admin API. The Firestore emulator does not implement that call, so name the databases explicitly when pointing the plugin at one.

Required Permissions

The service account needs read access to the project's databases:

  • datastore.databases.list and datastore.databases.get to list Firestore databases
  • datastore.entities.list to read the collections and sample their documents
  • firebasedatabase.instances.list to list Realtime Database instances
  • firebase.projects.get to read the project name and number

The predefined roles roles/datastore.viewer and roles/firebase.viewer cover all of these.

Example Configuration


project_id: "my-firebase-project"
credentials_file: "/path/to/service-account.json"
sample_documents: 50
max_collection_depth: 2
include_realtime_database: true
filter:
include:
- "^firestore/.*"
exclude:
- ".*_tmp$"
tags:
- "firebase"
- "firestore"

Configuration

The following configuration options are available:

PropertyTypeRequiredDescription
credentials_filestringfalsePath to service account JSON file
credentials_jsonstringfalseService account JSON content
databases[]stringfalseFirestore database IDs to scan. Every database is listed from the API when this is empty. The Firestore emulator has no such API, so name the databases here when pointing at one
disable_authboolfalseDisable authentication, for local testing
endpointstringfalseCustom endpoint URL, for testing against a local server
external_links[]ExternalLinkfalseExternal links to show on all assets
filterFilterfalseFilter discovered assets by name (regex)
include_project_detailsboolfalseWhether to read the Firebase project name and number
include_realtime_databaseboolfalseWhether to discover Realtime Database instances
include_subcollectionsboolfalseWhether to descend into subcollections
max_collection_depthintfalseHow many levels of subcollection to descend
project_idstringtrueGoogle Cloud project ID
sample_documentsintfalseHow many documents to read per collection to infer its fields
tagsTagsConfigfalseTags to apply to discovered assets

Available Metadata

The following metadata fields are available:

FieldTypeDescription
collection_group_idstringID a collection group query uses to reach every copy of a subcollection
collection_idstringCollection ID, the last segment of the path
collection_pathstringCollection path with parent document IDs left out
column_namestringDocument field name
concurrency_modestringDefault transaction concurrency control mode
create_timestringWhen the database was created
data_typestringInferred Firestore type, or mixed when the sample disagreed
database_idstringFirestore database ID, (default) for the default database
database_kindstringWhich Firebase database this is: firestore or realtime
database_typestringFIRESTORE_NATIVE or DATASTORE_MODE
database_urlstringHostname the instance is served on
delete_protectionstringWhether the database is protected from deletion
depthintNesting level, 1 for a root collection
earliest_version_timestringOldest timestamp a read can ask for
firebase_project_display_namestringProject display name
firebase_project_idstringFirebase project ID
firebase_project_numberint64Google-assigned project number
free_tierboolWhether the database is eligible for the free tier
instance_idstringRealtime Database instance ID
instance_typestringDEFAULT_DATABASE or USER_DATABASE
is_nullableboolWhether the field was absent or null in any sampled document
location_idstringRegion the database runs in
parent_pathstringPath of the parent collection, for subcollections
point_in_time_recoverystringWhether point in time recovery is enabled
sampled_documentsintHow many documents were read to infer the fields
statestringLifecycle state, for example ACTIVE or DISABLED
uidstringSystem-generated database UUID
update_timestringWhen the database resource was last changed
version_retention_periodstringHow long past versions of the data are readable