The Simplest Way to Make Google Pub/Sub and Redash Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Pairing google pub/sub and redash lets your team turn live event streams into SQL charts. Messages move from your message bus into a database, where analysts run queries and build dashboards. Google Pub/Sub handles fast message delivery between your services. Redash reads stored data so teams can build charts and share insights. Because Redash queries databases rather than message queues, you need a storage step in between. Setting up this pipeline with clear permissions keeps your data safe an

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.

Pairing google pub/sub and redash lets your team turn live event streams into SQL charts. Messages move from your message bus into a database, where analysts run queries and build dashboards.

Google Pub/Sub handles fast message delivery between your services. Redash reads stored data so teams can build charts and share insights. Because Redash queries databases rather than message queues, you need a storage step in between. Setting up this pipeline with clear permissions keeps your data safe and easy to read.

How data flows between google pub/sub and redash

Your apps send event messages to a Google Pub/Sub topic as user actions happen. A subscriber worker or cloud pipeline pulls those messages from the subscription right away. That worker writes the event records into a relational database or a cloud data warehouse. Once the rows land in tables, Redash connects to that data store and runs SQL queries.

Each step in this pipeline relies on its own identity and role. The publishing app uses a cloud service account that can only send messages to one topic. The subscriber service uses a separate role that pulls messages and writes rows into your database. Finally, Redash uses a read-only database user to run select queries and refresh charts on a schedule.

This separation keeps your analytics tool from touching live production queues. If an analyst writes a heavy query in Redash, it only affects the reporting database. Your core message bus keeps taking new events without any drop in speed.

Common failure modes and how to scope roles

Many teams take shortcuts when they first wire up this event pipeline. A common mistake is sharing one broad cloud service account across the whole stack. If the subscriber and the reporting tool share a key, a leak exposes everything. An attacker could delete topics, read raw queues, or alter historical tables.

Another frequent issue occurs when teams give Redash a database user with write permissions. Analysts only need to read tables to build charts and alerts. If the Redash user can drop tables or update rows, a typo in SQL causes real damage. Shared database accounts also make audit logs hard to read during a security review. Every query in the database log shows up under the same generic app name.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Raw event payloads also create privacy risks when they flow straight into reporting tables. User events often carry emails, phone numbers, card numbers, or national IDs inside the message body. If those fields land in open tables, anyone with Redash access can query them. Data masking rewrites matched fields in results so analysts can still group trends safely.

Securing network paths and query logs

You can fix these risks by scoping every role to the smallest possible set of actions. Give your subscriber worker permission to read one subscription and insert into one staging schema. Create a dedicated read-only user for Redash that only queries clean reporting views. Lock down your network rules so the database only accepts traffic from known internal addresses.

Good audit logs are just as important as tight network rules. Your security team needs to know which person ran a query and when they ran it. Map your team members to their own identities instead of sharing one admin login in Redash. Rotate your cloud keys and database passwords on a regular schedule to limit exposure.

When you separate ingestion roles from query roles, your pipeline stays fast and easy to audit. Engineers can ship new event types to the bus while analysts explore clean tables in peace.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Can Redash query a Google Pub/Sub topic directly?

No, Redash needs a queryable data store to run reports and build charts. You must route your messages into a SQL database or data warehouse before querying them in Redash.

What database permissions should the Redash user have?

Give the Redash database user read-only select permissions on specific reporting views or schemas. Never grant write, update, delete, or admin rights to the account that runs your dashboard queries.

How do we handle sensitive fields in event payloads?

Events often contain emails, phone numbers, or card numbers that should not appear in plain text. Strip those fields during ingestion or use data masking to rewrite matched fields in query results.

The query runs. The emails stay hidden.