How to Integrate Looker and Firestore Safely

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams link looker and firestore by routing document data through an SQL analytics warehouse. This setup lets analysts build charts from live app data without hurting database speed. Firestore stores data as JSON documents for fast mobile and web app reads. Looker needs structured SQL tables to build semantic models and run group queries. A safe link between these tools protects both app performance and private customer data. How data and roles flow between looker and firestore Looker cannot

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Teams link looker and firestore by routing document data through an SQL analytics warehouse. This setup lets analysts build charts from live app data without hurting database speed.

Firestore stores data as JSON documents for fast mobile and web app reads. Looker needs structured SQL tables to build semantic models and run group queries. A safe link between these tools protects both app performance and private customer data.

How data and roles flow between looker and firestore

Looker cannot run SQL queries straight against a document database like Firestore. Instead, teams stream Firestore changes into BigQuery or use federated table links. Looker then logs in to that SQL layer to read the mapped fields.

Data flows in one direction from your operational app store to your charts. When an app writes a new document, an export job copies the payload. The job adds a row to a raw change log table in your warehouse. A view then flattens those nested JSON fields into clean SQL columns for analysts.

Permissions must match each step of this data pipeline. The sync worker needs a role that can only read your source collections. Looker needs a separate service account that only reads the flattened analytics views. Neither role should ever hold write permissions on your live app database.

Common failure modes and how to scope access

Many teams make the mistake of sharing one broad service account across tools. If an engineer reuses an admin key for reporting, one leak exposes everything. A bad query or stolen key could wipe out live production collections.

Unlogged queries create another major blind spot for security teams. When ten analysts share one database login, audit logs only show the shared account. You cannot tell which team member ran a slow query or exported customer rows.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Nested documents also carry hidden personal data into analytics tables by mistake. A user document might hold emails, phone numbers, card numbers, or national IDs. When a streaming job copies the whole document, all those fields land in Looker. Data masking rewrites matched fields in results before they reach the chart layer.

To fix these risks, split your roles by task and lock down network paths. Give the export job read access only to the specific collections needed for reports. Keep private auth collections out of the sync scope from day one. Set up VPC controls so the warehouse only accepts traffic from known internal hosts.

Managing schema changes and query load in production

App developers change document shapes often without warning the data team. When a field changes from a string to an array, Looker models can break. Build a SQL view layer to cast data types and handle missing fields.

Heavy chart refreshes can also drive up warehouse scan costs fast. Set up table partitioning by date on your synced change log tables. Tell Looker to require a date filter on every dashboard query by default. This simple rule keeps reports fast and prevents full table scans during peak hours.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Can Looker query Firestore collections directly without a warehouse?

No, Looker requires a SQL interface to build models and run queries. You must sync or federate your document data into a SQL warehouse first.

How do we keep sensitive document fields out of Looker charts?

Filter out private fields during the sync step or apply data masking rules. Masking rewrites matched fields like emails and card numbers in query results.

What permissions should the Looker service account hold?

Give the Looker account a read-only role scoped only to clean analytics views. Never grant it write permissions or direct access to raw app collections.

The query runs. The emails stay hidden.