The Simplest Way to Make Teamcity and TimescaleDB Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Using teamcity and timescaledb together lets teams run schema jobs and store build metrics. The build server runs tasks that write time-series events or update database tables. Many teams rely on this pair to test fast time-series queries before shipping code. Others push build duration, test pass rates, and agent load into time-series tables. Both workflows need clear network rules, tight database roles, and clean logs. How teamcity and timescaledb share data and roles A build agent needs a

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.

Using teamcity and timescaledb together lets teams run schema jobs and store build metrics. The build server runs tasks that write time-series events or update database tables.

Many teams rely on this pair to test fast time-series queries before shipping code. Others push build duration, test pass rates, and agent load into time-series tables. Both workflows need clear network rules, tight database roles, and clean logs.

How teamcity and timescaledb share data and roles

A build agent needs a clear network path and a valid key to log in. When a pipeline starts, the build server assigns a job to a runner agent. That agent opens a database session over TLS to run schema tasks or write metrics.

Good setups separate schema changes from metric writes by using two distinct database roles. The schema role can alter tables and manage time-based chunks during a release job. The metric role can only insert new rows into the build history table. This split stops a basic reporting job from dropping a core table by mistake.

Teams also use temporary test instances during pull request checks. The build agent spins up a clean database, applies pending schema updates, and runs tests. When the build finishes, the agent tears down the test instance to save space. For production jobs, the agent connects to the live database using scoped credentials.

Common failure modes and how to scope permissions

Problems start when every pipeline shares one master database account with admin rights. If a build script prints a secret to the log, anyone can read it. A single leaked password then puts every time-series table at risk across all projects.

Long-lived secrets stored in project variables also create big audit gaps over time. When ten pipelines use the same user name, database logs cannot show who ran what. You see a bad query in the log, but you cannot trace the build.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Network sprawl is another common trap for growing engineering teams. Opening the database port to an entire pool of shared build agents increases risk. An untrusted test job on a shared agent could reach a live production database.

To fix this, tag specific build agents for production database jobs only. Place those dedicated agents in a locked network subnet with strict firewall rules. Give each project its own database role with permissions scoped to specific tables. Rotate those database keys often and keep them out of plain text build scripts. Always turn on database audit logging so every schema change links to a build.

Managing schema updates for time-series tables

Time-series tables grow fast and need careful care during automated build runs. Standard schema tools work well, but you must plan for compressed data chunks. Altering a compressed chunk during a busy write window can lock up your pipeline.

Set up your build steps to check table locks before running heavy schema changes. Run short validation steps first to catch syntax errors before touching live production data. Keep build steps small so failed runs are easy to fix and roll back. If a job fails, the pipeline should stop right away and alert the team.

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

Should build agents use one shared database user for all pipelines?

No, shared accounts hide which pipeline or developer ran a specific database query. Create separate database roles for schema updates, metric writes, and read-only test checks.

How can teams protect sensitive fields during test runs?

Use data masking to rewrite matched fields like emails, phone numbers, or card numbers. This keeps test results safe when build jobs query production-like time-series data.

Where should production database jobs run in a build farm?

Run production jobs on dedicated build agents inside a restricted network zone. Never allow untrusted pull request builds to run on agents with production network paths.

The query runs. The emails stay hidden.