The Simplest Way to Make AWS RDS and Gerrit Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair aws rds and gerrit to store code review state in a managed database. Gerrit tracks git changes, while AWS RDS stores account data and review metadata. This setup keeps review history safe when app servers restart. It also helps teams scale read traffic across many nodes. You get backups and failovers without managing database disks by hand. How data and logins flow between aws rds and gerrit Gerrit uses a database or its own git store to hold review state. When you link it to AWS

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 pair aws rds and gerrit to store code review state in a managed database. Gerrit tracks git changes, while AWS RDS stores account data and review metadata.

This setup keeps review history safe when app servers restart. It also helps teams scale read traffic across many nodes. You get backups and failovers without managing database disks by hand.

How data and logins flow between aws rds and gerrit

Gerrit uses a database or its own git store to hold review state. When you link it to AWS RDS, the app sends SQL queries over your network. These queries read and write user profiles, group rules, and change metadata.

First, the Gerrit host needs a clear network path to the RDS instance. Teams place both systems in the same virtual network. Security groups then limit database traffic to the exact Gerrit host IP.

Next, the app logs in to the database engine. Many teams use a static database user and password stored in a local file. Other teams use cloud identity roles to fetch temporary login tokens. Once logged in, Gerrit keeps a pool of open database sessions ready for work.

Human admins also query the RDS instance from time to time. They check slow queries, fix stuck review states, or run schema updates during upgrades.

Common failure modes and how to scope roles

The biggest risk in this setup is a shared root database account. Teams often give the Gerrit app and human admins the same main login. If that password leaks, anyone can drop tables or alter code review records.

Broad network rules create another common failure mode. If the RDS subnet allows traffic from all internal hosts, any compromised box can reach it. Unlogged admin queries also cause trouble during audits. When two engineers share one database user, logs cannot show who ran a bad write.

AWS IAM Policies + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

To fix this, split database roles by task. Give the Gerrit app a dedicated role that only reads and writes its own tables. Create a separate role for schema migrations and lock it when upgrades finish.

Give human admins read-only roles for daily checks. When an admin needs to fix data, require a short approval step first. Turn on database query logs so you can trace every change back to a person. Also mask sensitive fields like emails or phone numbers in query results.

Running schema upgrades and backups safely

Upgrading Gerrit often updates the underlying database schema. If an engineer runs an upgrade script with a bad role, tables can lock up. This stops all code reviews across the engineering team.

Always take an RDS snapshot right before you run any Gerrit upgrade. Test the schema change against a restored copy of the database first. Keep the migration role separate from the daily app role. This prevents the app from altering table structures during normal runs.

Check your connection pool limits before peak work hours as well. If Gerrit opens too many sessions at once, RDS will reject new logins. Set clear pool limits on the app side and watch open session counts in cloud logs.

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

Does Gerrit store git code blobs inside AWS RDS?

No, Gerrit keeps raw git objects on disk and uses RDS for review metadata and accounts.

How should we restrict network paths to the RDS database?

Place RDS in a private subnet and only allow inbound database ports from Gerrit server security groups.

Why should human admins avoid using the Gerrit service account?

Shared accounts hide who ran a query and give humans broad write rights they do not need.

The query runs. The emails stay hidden.