Back to browse
PgBeam – A globally distributed PostgreSQL proxy

PgBeam – A globally distributed PostgreSQL proxy

by sferadev·Feb 26, 2026·3 points·0 comments

AI Analysis

●●●BangerSolve My ProblemSlick

Wire-protocol transparent pooling and edge caching vs Hyperdrive's Cloudflare-only lock-in.

Strengths
  • Zero code changes—swap connection string only, speaks native PG wire protocol
  • Live multi-region latency benchmarks (20 regions, 5 samples) with published methodology
  • 3-5x latency reduction for distant regions; tackles real pain (Tokyo to us-east-1 400-800ms)
Weaknesses
  • Read-only caching limits use cases requiring write consistency guarantees
  • Eventually consistent (60s staleness) may not fit real-time analytics or financial workflows
Target Audience

Backend engineers, SaaS platforms with global users, serverless applications

Similar To

Hyperdrive · Prisma Accelerate · PgBouncer

Post Description

PostgreSQL connections from distant regions are expensive. A new connection from Tokyo to a database in us-east-1 costs 400-800ms before the first query runs: TCP handshake, TLS (2 RTTs), PG startup and auth.

- PgBouncer pools connections but doesn't cache and runs in a single region.

- Hyperdrive does both but only works from Cloudflare Workers.

- Prisma Accelerate requires the Prisma ORM.

PgBeam is a PostgreSQL proxy that speaks the wire protocol natively. You only change one environment variable:

Before: postgresql://user:[email protected]:5432/postgres

After: postgresql://user:[email protected]:5432/postgres

Three things happen:

1. Routing: GeoDNS points to the nearest proxy (6 regions today)

2. Connection pooling: Warm upstream connections, no TLS/auth cost per query

3. Query caching: SELECTs cached at the edge with stale-while-revalidate. Writes, transactions, and volatile functions like NOW() or RANDOM() are never cached.

Live benchmark at https://pgbeam.com/benchmark with real TLS PostgreSQL connections from 20 global regions, comparing direct vs. PgBeam (cached and uncached). No synthetic data.

This is a technical preview meant for design partners and early customers via a private beta before scaling the infrastructure. Feedback is welcomed!

Similar Projects