hn.today

Open sourcing PG Proxy: How we proxy 4T queries a month

datadoghq.com7 points0 comments
Screenshot of Open sourcing PG Proxy: How we proxy 4T queries a month

PG Proxy is Datadog’s open-source PostgreSQL proxy, written in Go, designed to consolidate connection pooling and traffic management that previously required a mix of direct connections, PgBouncer, HAProxy, and Envoy. That fragmented setup meant separate configurations and limited visibility, and made database migrations dependent on coordinated DNS changes and application redeployments. PG Proxy gives applications a stable access point while platform teams centrally manage backend destinations. It supports self-managed and cloud-hosted PostgreSQL and can be run as a supplied application or integrated as a Go library.

The proxy uses transaction pooling to let many client connections share fewer PostgreSQL connections, and supports named prepared statements with pooling. It can route eligible read-only transactions to replicas, falling back to the primary if a replica cannot provide a connection promptly; applications can disable this routing when they need immediate visibility of their own writes. Central routing also enables staged migrations and draining transactions before cutovers. Authentication hooks and tracing integrations connect database access to service identity and help follow requests, though Datadog’s JWT system, load shedding, autoscaling, and database-monitoring integration are not part of the open-source release. Datadog reports using PG Proxy across thousands of hosts and hundreds of clusters, handling four trillion messages monthly, more than 200 million authentications daily, and over 600,000 open client connections.

Read on datadoghq.com0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Show HN: Rust Commander

Show HN: Rust Commander

Rust Commander is a Rust terminal file manager modeled on Midnight Commander, with dual-pane navigation, a persistent shell, archive and remote browsing, and background file operations. Version 0.3.1 adds file-change alerts, viewer copy controls, customizable skins, and faster SFTP previews and copying. (github.com)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.