pgcache — zsh — 120×40
$cat /etc/pgcache/welcome.txt
____ ____ _ | _ \ __ _/ ___|__ _ ___| |__ ___ | |_) / _` \___ \ / _` |/ __| '_ \ / _ \ | __/ (_| |___) | (_| | (__| | | | __/ |_| \__, |____/ \__,_|\___|_| |_|\___| |___/
Effortless caching for PostgreSQL.
v0.1.0 | https://pgcache.com
$pgcache explain --problem
THE PROBLEM
You're hitting database limits. Queries that were fast are now slow. You need caching, but caching is hard:
✗ Manual cache invalidation = bugs everywhere ✗ Redis clusters = more infrastructure to manage ✗ ORM caching = breaks on complex queries ✗ Stale data = angry users
$pgcache explain --solution
THE SOLUTION
PgCache is a transparent caching proxy for PostgreSQL. It sits between your app and your database:
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ Your App │ ───▶ │ PgCache │ ───▶ │ PostgreSQL │ │ (any lang) │ │ (cache + │ │ (your data) │ │ │ │ invalidate)│ │ │ └─────────────┘ └─────────────┘ └─────────────┘
Every SELECT is cached. Every INSERT/UPDATE/DELETE triggers smart invalidation. Zero code changes required.
$pgcache install --demo
HOW IT WORKS
[1] Deploy PgCache (Docker, K8s, or binary)
$ docker run -d --name pgcache \ -e UPSTREAM_URL=postgres://localhost:5432/myapp \ -p 5433:5433 \ pgcache/pgcache:latest ✓ PgCache running on port 5433
[2] Update your connection string
# Before DATABASE_URL=postgres://localhost:5432/myapp # After DATABASE_URL=postgres://localhost:5433/myapp
[3] That's it. Your queries are now cached.
$ psql postgres://localhost:5433/myapp myapp=# SELECT * FROM users WHERE active = true; -- Time: 142.385 ms (cache miss, fetched from upstream) myapp=# SELECT * FROM users WHERE active = true; -- Time: 0.847 ms (cache hit)⚡ 168x faster myapp=# UPDATE users SET name = 'Alice' WHERE id = 1; -- Cache invalidated for affected queries myapp=# SELECT * FROM users WHERE active = true; -- Time: 138.291 ms (cache miss, fresh data)
$pgcache features --list
FEATURES
zero_code_changes Point your app at PgCache. Done. smart_invalidation Tracks writes, clears affected queries. wire_compatible Native PostgreSQL protocol. Any ORM works. observability Built-in metrics: hit rate, latency, etc. fine_grained TTLs, exclusions, query patterns. production_ready Connection pooling, HA, graceful degradation.
$pgcache stats --sample
SAMPLE METRICS
┌────────────────────────────────────────────────────────┐ │ PgCache Statistics (last 24h) │ ├────────────────────────────────────────────────────────┤ │ Cache Hit Rate: 94.7% │ │ Queries Cached: 1,284,392 │ │ Avg Cache Latency: 0.8ms │ │ Avg Upstream Latency: 147ms │ │ Invalidations: 12,847 │ │ Memory Used: 2.1 GB / 8 GB │ └────────────────────────────────────────────────────────┘
$pgcache info --personas
WHO IT'S FOR
INFRA ENGINEERS Reduce DB load without app changes BACKEND DEVS Ship features, not cache plumbing CTOs Defer expensive database upgrades SREs Protect your DB from traffic spikes
$pgcache join --waitlist
GET EARLY ACCESS
PgCache is currently in private beta. Join the waitlist to be first in line:
No spam. Unsubscribe anytime.
$▊