The Simplest Way to Make Cloud SQL and Minio Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use cloud sql and minio together to split structured rows from large files. The database stores record metadata while the audit storage holds raw files and backups. This split keeps your relational tables small and fast during peak traffic. Your apps read file paths from the database and fetch objects from storage. How cloud sql and minio share data and permissions The two systems do not talk to each other over a direct link. Instead, a worker app or script sits between the database 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.

Teams use cloud sql and minio together to split structured rows from large files. The database stores record metadata while the audit storage holds raw files and backups.

This split keeps your relational tables small and fast during peak traffic. Your apps read file paths from the database and fetch objects from storage.

How cloud sql and minio share data and permissions

The two systems do not talk to each other over a direct link. Instead, a worker app or script sits between the database and the buckets.

The worker logs into the database to read or write file locations. Then it uses separate keys to put or get files in the bucket.

Cloud SQL for PostgreSQL is a managed service with strict role rules. Customers cannot create or use database accounts with true superuser attributes.

Instead, you grant the cloudsqlsuperuser role to admin users who need high rights. This role lets users create extensions, event triggers, and replication publications or subscriptions.

The default postgres user belongs to cloudsqlsuperuser and can create roles and databases. Still, it comes with no password, so you must set one before logging in.

A system user named cloudsqladmin holds the actual superuser rights on the instance. Customers cannot delete or change these built-in system roles or users.

On the storage side, MinIO uses access keys and policies to guard buckets. Each app should get its own database user and its own bucket policy.

Common failure modes and how to scope roles

Problems start when teams share one admin account across many worker scripts. If a script uses the default postgres user, it has too much power.

A bug or bad query in that script can drop tables or roles. Shared storage keys cause the same risk on the object storage side.

End-to-End Encryption + SQL Query Filtering: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

If every service uses one root key, any leaked key exposes all buckets. Another common gap is a lack of clear audit logs across both tools.

When five apps share one login, you cannot tell who ran a query. You also cannot see which person or job pulled a sensitive file.

To fix this, create a distinct database role for each app or job. Give read-only roles to jobs that only export data to object buckets.

Keep the cloudsqlsuperuser role for rare schema changes and setup tasks only. Scope each storage policy to the exact bucket prefix that the worker needs.

Place both systems on private networks so public traffic cannot reach their ports. Use firewall rules to allow traffic only from known worker hosts.

Protecting sensitive fields during data exports

Teams often dump database tables into object buckets for analytics or backups. Raw dumps can carry emails, phone numbers, card numbers, or national IDs.

Once a file lands in a bucket, many people might download it. You should limit what sensitive text leaves the database during an export.

Data masking rewrites matched fields in query results before they reach the caller. This keeps raw emails and card numbers out of exported bucket files.

Tie every human query and storage action to an individual user identity. That way, your logs show who ran each query and who read each bucket.

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 I use a true superuser account in Cloud SQL for PostgreSQL to run exports?

No, customers cannot create or use accounts with true superuser attributes. You use the cloudsqlsuperuser role for admin tasks, or a scoped read-only role for exports.

Store the bucket name and object key as text columns in your table. Your app queries the row first, then fetches the object using that path.

Why should teams avoid using the default postgres user for worker jobs?

The default postgres user belongs to cloudsqlsuperuser and can create roles and databases. Worker jobs only need read or write rights on specific tables.

The query runs. The emails stay hidden.