What is a read replica?
A read replica is a second Postgres server that continuously applies the primary’s changes and answers read-only queries. Postgres added this in version 9.0, released in September 2010, with two features: streaming replication, which sends the primary’s write-ahead log to a standby over the network, and hot standby, which lets that standby answer read-only queries.
Managed services offer replicas as a built-in feature. On Amazon RDS for PostgreSQL, each read replica keeps its own full copy of the data. Aurora works differently: its readers share the cluster’s storage volume, and each reader is a separate database instance.
Teams use replicas for more than read capacity. A replica can be promoted to replace a failed primary, and it can run reporting queries and backups away from the primary.
What is PgCache?
PgCache is a transparent, wire-compatible caching proxy and smart read replica for PostgreSQL. It sits between your application and your database without requiring application code changes, and keeps its cache current through Postgres logical replication. Writes, and reads PgCache can't serve from cache, go to your database.
PgCache works with PostgreSQL 16, 17 and 18, including Amazon RDS and Aurora. It's source-available under the Elastic License 2.0.