PgCache vs Debezium and Redis
Debezium streams row changes out of Postgres. To keep Redis current with it, teams write a consumer that turns those changes into Redis updates. PgCache reads the same changes itself, with the cache built in, so there's no pipeline to build.
See which of your own queries PgCache would serve: check your workload or open a sample report.
Debezium and Redis facts checked against their docs on .
PgCache
A caching proxy with change data capture built in. It reads the logical replication stream itself and keeps the data it has cached current.
- One thing to run
- No code that maps row changes to cache keys
- Picks what to cache from live traffic
Debezium + Redis
Debezium captures row changes from Postgres and streams them to Kafka or Redis Streams. Code you write turns those changes into cache updates in Redis.
Where they differ
| Topic | PgCache | Debezium + Redis |
|---|---|---|
| What you run | PgCache | Debezium, a stream such as Kafka, a consumer service and Redis |
| Code you write | None | A consumer that maps row changes to cache keys, plus cache code in the app |
| What it caches | SQL query results, picked from live traffic | Whatever your app and consumer put in Redis |
| Freshness | Within typical logical replication lag | Replication lag plus the pipeline’s own delay |
Which one fits
Choose PgCache when
- You want a cache kept current from Postgres changes, without building a pipeline
- What you cache is the result of SQL queries
Choose Debezium and Redis when
- You already run Debezium or Kafka
- Changes also need to reach search, analytics or other services
What they have in common
- Both keep a cache current from the Postgres replication stream
- Neither speeds up writes
Common questions
Does PgCache use Debezium?
No. PgCache reads the Postgres logical replication stream itself.
Can I keep Debezium and add PgCache?
Yes. PgCache uses its own replication slot, so your other pipelines keep running.
What about Redis Data Integration?
Redis Data Integration is Redis’s packaged version of this pipeline. It runs on Debezium and is available with Redis Enterprise and Redis Cloud. Your app still reads from Redis instead of running SQL.
Sources
- Debezium docs: PostgreSQL connector
- Debezium docs: Debezium Server
- Redis docs: Redis Data Integration architecture
- PgCache docs: How caching works
If something here is out of date, please write to [email protected].
See where your own queries land
Step 1
Check your workload
Paste a pg_stat_statements export or a Postgres log. In about a minute you see which of your queries PgCache would serve from cache.
No export handy? See a sample report
Runs in your browser. Nothing is uploaded.
Step 2
Get a free workload review
30 minutes with the founders, by video or email. Bring your Fit report or your Postgres problem.
- What PgCache would serve and save on your workload
- If it fits, a pilot with hands-on help
Prefer email? [email protected]
Already curious? Request a pilot
Free. Pick any open time on our calendar.
Run it yourself: Source on GitHub · Try it in one command
Not ready yet? Get updates by email.