The Simplest Way to Make Citrix Adc and CockroachDB Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair citrix adc and cockroachdb to route SQL traffic across distributed database nodes. This setup spreads client queries across healthy nodes and keeps apps running during outages. CockroachDB runs as a cluster of identical nodes that all accept client requests. Citrix ADC sits in front of those nodes and distributes incoming TCP sessions. When a node fails, the load balancer shifts traffic to the remaining active nodes. This design helps engineering teams maintain high uptime without ch

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 citrix adc and cockroachdb to route SQL traffic across distributed database nodes. This setup spreads client queries across healthy nodes and keeps apps running during outages.

CockroachDB runs as a cluster of identical nodes that all accept client requests. Citrix ADC sits in front of those nodes and distributes incoming TCP sessions. When a node fails, the load balancer shifts traffic to the remaining active nodes. This design helps engineering teams maintain high uptime without changing app settings.

How citrix adc and cockroachdb handle traffic and logins

In a standard setup, Citrix ADC acts as a network load balancer for SQL traffic. Client apps send requests to a single virtual IP address on the appliance. The appliance then forwards those TCP packets to an active CockroachDB node.

To pick a good node, the appliance runs regular health checks against the cluster. Each database node exposes an HTTP endpoint that reports its current readiness state. Citrix ADC polls this endpoint to confirm the node can take traffic. If a node reports a bad status, the appliance stops sending sessions to it.

For logins, most teams pass encrypted TLS traffic straight through the load balancer. The database node itself checks the client certificate or password during the login step. Once the user logs in, CockroachDB checks role rules to allow or block queries. The load balancer only sees network packets, while the database handles user permissions.

Common failure modes and how to scope roles

Relying only on network routing creates blind spots for security and operations teams. Because Citrix ADC passes TCP traffic through, it does not log SQL queries. Network logs show client IP addresses and port numbers, but hide the actual commands.

This gap grows worse when apps or engineers use shared database accounts. Many teams use a single admin role for both app traffic and manual debugging. When someone runs a bad query, audit logs cannot tie it to a person. Broad roles also let users read sensitive fields like emails and card numbers. Without field masking, query results return raw phone numbers and national IDs to everyone.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Connection timeouts also cause trouble between the load balancer and the database cluster. If idle timeout rules do not match on both sides, active sessions drop. Apps then face sudden errors during long transactions or periods of low traffic.

To fix these risks, teams must lock down both network paths and database roles. Start by placing the database nodes in a private subnet with strict firewall rules. Only allow the Citrix ADC subnet to talk to the database SQL ports. Next, remove shared admin accounts for human users and create narrow roles instead. Give each app and team only the read or write permissions they need. Finally, align TCP keepalive timers on both systems so idle connections close cleanly.

Monitoring cluster health and query activity

Keeping this pair stable requires clear visibility at both the network and database layers. Teams should track connection counts and backend response times on the Citrix ADC side. A sudden drop in active sessions on one node often warns of disk issues.

On the CockroachDB side, teams should turn on audit logging for sensitive tables. Audit logs record which database role ran a query and when it happened. Combining network metrics with SQL logs helps teams spot slow queries and bad logins fast. Regular reviews of active roles also keep old permissions from piling up over time.

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

Should Citrix ADC terminate TLS for CockroachDB traffic?

Most teams use TCP passthrough so the database nodes handle TLS termination directly. This approach lets CockroachDB check client certificates for mutual TLS logins without extra steps.

How does Citrix ADC know when a CockroachDB node is down?

You set up an HTTP monitor on the appliance that checks the node health path. When a node drains or fails, that path returns an error code right away.

Why do database connections drop through the load balancer?

Connections drop when the load balancer idle timeout is shorter than the app pool timer. Set the appliance timeout higher than your database connection pool lifetime to stop drops.

The query runs. The emails stay hidden.