awselasticachememorydbrediscost-optimization

ElastiCache vs MemoryDB cost: when durability is worth paying for

MemoryDB costs more than ElastiCache for the same node type and adds a per-GB data-written charge ElastiCache doesn't have. Here's the price difference, the durability you're buying, and when each is the right call.

The C3X Team··9 min read

Quick answer

MemoryDB costs more than ElastiCache for the same node type and adds a ~$0.20/GB data-written charge ElastiCache doesn't have. You're paying for a durable multi-AZ log that makes MemoryDB a primary datastore. If Redis is a cache in front of another database, ElastiCache is cheaper and correct. If Redis is your system of record, MemoryDB's premium buys the durability you'd otherwise build yourself.

Both run Redis-compatible in-memory workloads on AWS, and at a glance they look interchangeable. They are not, and the cost difference traces directly to one feature: durability.

The pricing difference

ElastiCache (cache)

  • Node-hours by node type (e.g. cache.r6g.large ~$0.204/hour)
  • Backup storage beyond one free snapshot per node
  • No charge for writes

MemoryDB (durable datastore)

  • Node-hours by node type, at a higher rate than the equivalent ElastiCache node
  • Data written to the durable log: ~$0.20/GB
  • Snapshot storage beyond the free allowance

Node count works the same for both: shards times (1 + replicas per shard). The divergence is the per-GB data-written charge, which is unique to MemoryDB and can be the larger line for write-heavy workloads.

What the premium buys

MemoryDB keeps a multi-AZ transaction log, so committed writes survive a node or zone failure. That lets it be the primary store for data you can't afford to lose, no separate database required. ElastiCache is an in-memory cache: fast, but if a node fails you rebuild from the source of truth. The price gap is the cost of not needing that source of truth.

When to choose which

  • ElastiCache: Redis sits in front of a database (RDS, DynamoDB) and can be rebuilt on failure. Most caching use cases.
  • MemoryDB: Redis is the system of record, session stores you can't lose, leaderboards, real-time state with durability needs.

See the real number before you decide

The data-written charge makes MemoryDB hard to estimate by intuition. Price both directly: aws_elasticache_replication_group and aws_memorydb_cluster both have full pricing breakdowns, and C3X estimates either from your Terraform with the write volume from a usage file.

# Compare both in one estimate
c3x estimate --path . --usage c3x-usage.yml

For the broader caching picture, see DynamoDB on-demand vs provisioned for the durable-store alternative.

Try C3X on your own Terraform

Free and open source. No API key required. One command to install, one command to estimate.