The Simplest Way to Make Backstage and CockroachDB Work Like They Should
Teams use Backstage and CockroachDB to run a fast, safe service catalog in production. Backstage holds your app list while CockroachDB stores the catalog state across regions. This pair gives developers one home to find services, docs, and owners. The database keeps the portal up even if one cloud zone fails. To make them work well, you must set up clean logins and tight rules. How Backstage and CockroachDB share data and logins Backstage uses a standard database driver to talk to its storag
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 Backstage and CockroachDB to run a fast, safe service catalog in production. Backstage holds your app list while CockroachDB stores the catalog state across regions.
This pair gives developers one home to find services, docs, and owners. The database keeps the portal up even if one cloud zone fails. To make them work well, you must set up clean logins and tight rules.
How Backstage and CockroachDB share data and logins
Backstage uses a standard database driver to talk to its storage backend. Since CockroachDB speaks the Postgres wire protocol, the portal connects without custom code. The portal runs background tasks that read and write catalog items all day.
First, the portal logs in to the database using a cert or password. Next, each portal plugin asks for its own logical database or schema. One schema holds the software catalog, and another holds user settings. A third schema tracks scaffold jobs and search index rows.
When a user opens a page, the portal backend queries the cluster. The cluster routes that read to the closest node with current data. When a git change updates a service file, the portal writes new rows. The cluster copies those writes across nodes so no catalog data gets lost.
Common failure modes and how to scope roles
Many teams start by giving the portal one root database account. That single shared user can drop tables, read all schemas, and change cluster settings. If one custom plugin has a bug, it can break the whole database. Worse, when engineers use that same account to debug, logs hide who ran what.
Unlogged queries also cause pain during an audit or outage. A developer might run a big scan to check a stuck catalog job. If they hold write rights, a typo can wipe out service owner records. Raw query results might also return sensitive emails or phone numbers from user tables.
End-to-End Encryption + Backstage Security Plugins: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
You can fix this by splitting database roles by task and plugin. Create one role for the portal app with read and write rights on catalog tables. Do not grant cluster admin rights to the everyday app role. Run schema upgrades in a separate build step with its own migration role.
Next, lock down the network path between the portal pods and database nodes. Allow traffic only from the cluster subnet where your portal containers run. Require TLS certs for every client login so traffic stays encrypted on the wire. For human checks, give engineers read-only roles instead of the app password. Masking rules can also rewrite emails and card numbers in query results.
Keeping catalog queries fast across regions
A distributed database spreads rows across nodes that may sit miles apart. Backstage makes many small queries when it builds the service graph. If the portal sits in one region and queries another, pages load slow.
Keep your portal instances in the same region as your primary database nodes. Turn on connection pooling in the portal backend so it reuses open links. Opening a new TLS link for every page load wastes time and CPU. Set sensible pool limits so a traffic spike does not flood the cluster.
Watch your slow query logs to spot plugins that scan whole tables. Adding the right index on entity names or tags keeps catalog search snappy. Clean out old job history rows on a schedule so tables stay small.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.
First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Can Backstage use CockroachDB without custom database plugins?
Yes, the portal uses its built-in Postgres client to talk to the cluster. You should still test each third-party plugin to check its SQL queries.
Should all Backstage plugins share one database user?
No, sharing one broad user makes it hard to track bad queries. Give core plugins separate schemas and limit each role to its own tables.
How do engineers debug catalog data safely in production?
Engineers should never use the portal app password to run manual checks. Give staff individual read-only roles and log every query they run.
Related guides
In this post