What is ElastiCache?

Amazon ElastiCache is AWS’s managed in-memory cache service. AWS launched it in 2011 with Memcached, later added Redis, and added Valkey in October 2024. Today it runs Valkey, Redis OSS or Memcached, either serverless or on nodes you choose, inside your VPC. AWS handles provisioning, patching and node replacement.

To cache RDS or Aurora reads in ElastiCache, the app usually writes query results into the cache and clears them when the data changes. For Java apps, AWS’s Advanced JDBC Wrapper has a plugin that caches query results in ElastiCache. You add a TTL hint to each query you want cached.

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.