AWS MemoryDB is a fully managed, Redis-compatible, durable in-memory database that delivers microsecond reads and single-digit millisecond writes with Multi-AZ durability. With pricing based on node instances, data tiering, snapshots, and data transfer, MemoryDB is positioned between ElastiCache (pure caching) and traditional databases (full durability).
TL;DR: MemoryDB node pricing starts at $0.438/hr for db.r6g.large (~$320/month). Data tiering can reduce storage costs by moving infrequently accessed data to SSD at lower rates. Snapshots cost $0.085/GB-month. Choose MemoryDB over ElastiCache when you need both Redis speed and database-level durability.
Node Pricing
| Node Type | vCPUs | Memory | Price/hr | Monthly Cost |
|---|---|---|---|---|
| db.r6g.large | 2 | 13.07 GB | $0.438 | $320 |
| db.r6g.xlarge | 4 | 26.32 GB | $0.876 | $639 |
| db.r6g.2xlarge | 8 | 52.82 GB | $1.752 | $1,279 |
| db.r6g.4xlarge | 16 | 105.81 GB | $3.504 | $2,558 |
| db.r7g.large | 2 | 13.07 GB | $0.460 | $336 |
| db.r7g.xlarge | 4 | 26.32 GB | $0.920 | $672 |
| db.t4g.small | 2 | 1.37 GB | $0.060 | $44 |
| db.t4g.medium | 2 | 3.09 GB | $0.120 | $88 |
All MemoryDB nodes use Graviton processors. The t4g instances are suitable for development and testing, while r6g and r7g instances are designed for production workloads requiring consistent high performance.
Cluster Configuration
MemoryDB clusters require at least 1 shard with 1 node. For production with Multi-AZ durability, AWS recommends at least 1 shard with 2 nodes (1 primary + 1 replica). The minimum production cost is approximately $640/month (2x db.r6g.large).
Data Tiering
| Storage Tier | Pricing Basis |
|---|---|
| In-memory (RAM) | Included in node price |
| Data tiering (SSD) | Included in node price for r6gd nodes |
Data tiering is available on r6gd node types, which include local NVMe SSD storage. When enabled, MemoryDB automatically moves infrequently accessed data from memory to SSD, allowing you to store up to 5x more data per node while keeping frequently accessed data in memory for fast retrieval.
Data Tiering Node Pricing
| Node Type | Memory | SSD | Price/hr | Monthly Cost |
|---|---|---|---|---|
| db.r6gd.xlarge | 26.32 GB | 118 GB | $0.979 | $715 |
| db.r6gd.2xlarge | 52.82 GB | 237 GB | $1.958 | $1,429 |
| db.r6gd.4xlarge | 105.81 GB | 474 GB | $3.916 | $2,859 |
| db.r6gd.8xlarge | 209.55 GB | 948 GB | $7.832 | $5,717 |
Data tiering nodes cost approximately 12% more per hour than equivalent r6g nodes but can store significantly more data, reducing the number of shards needed.
Snapshot and Backup Pricing
| Component | Price |
|---|---|
| Snapshot storage | $0.085/GB-month |
| Snapshot retention | Configurable (1-35 days) |
| Free backup storage | Equal to total cluster data size |
MemoryDB provides free backup storage equal to the total size of your cluster data. Additional snapshot storage beyond that amount is charged at $0.085/GB-month. Snapshots are stored in S3 and include the full dataset at the point in time the snapshot was taken.
Data Transfer Pricing
| Transfer Type | Price |
|---|---|
| Same AZ | Free |
| Cross-AZ (replication) | $0.01/GB each direction |
| Cross-Region | Standard AWS data transfer rates |
| Internet egress | Standard AWS rates (starting at $0.09/GB) |
Multi-AZ replication generates cross-AZ data transfer charges. For a cluster writing 100 GB/day with a replication factor of 2, cross-AZ transfer adds approximately $60/month.
MemoryDB vs ElastiCache Comparison
| Factor | MemoryDB | ElastiCache (Redis) |
|---|---|---|
| Durability | Multi-AZ transactional log | Optional (Multi-AZ replication) |
| Use case | Primary database | Cache layer |
| Data persistence | Yes (survives node restarts) | Optional (AOF/RDB) |
| Write latency | Single-digit milliseconds | Sub-millisecond |
| Read latency | Microseconds | Microseconds |
| r6g.large price | $0.438/hr | $0.252/hr |
| Price premium | ~74% over ElastiCache | Baseline |
MemoryDB costs approximately 74% more than ElastiCache for equivalent node types. The premium pays for durable, transactional writes that survive node failures without data loss. If you need Redis purely as a cache where data loss is acceptable, ElastiCache is the more economical choice.
Real-World Cost Examples
| Use Case | Configuration | Monthly Cost |
|---|---|---|
| Dev/test | 1 shard, 1x db.t4g.medium | $88 |
| Small production | 1 shard, 2x db.r6g.large (primary + replica) | $640 |
| Session store | 2 shards, 2 nodes each, db.r6g.xlarge | $2,556 |
| Leaderboard/real-time | 4 shards, 2 nodes each, db.r6g.2xlarge | $10,233 |
| Large dataset (tiering) | 3 shards, 2 nodes each, db.r6gd.2xlarge | $8,573 |
Cost Optimization Tips
1. Use Data Tiering for Large Datasets
If your dataset exceeds available RAM, use r6gd nodes with data tiering instead of adding more shards. Data tiering can store 5x more data per node, potentially reducing your total node count and overall cost.
2. Right-Size Node Types
Monitor memory utilization, CPU, and network throughput via CloudWatch. If memory usage is consistently below 60%, consider downsizing to a smaller node type. MemoryDB supports online resharding for seamless scaling.
3. Evaluate MemoryDB vs ElastiCache
If your workload tolerates occasional data loss during failovers and does not require MemoryDB's transactional durability, ElastiCache provides the same Redis compatibility at approximately 42% lower cost.
4. Apply Reserved Node Pricing
For stable production workloads, Reserved Nodes offer up to 38% savings with 1-year commitments and up to 55% with 3-year commitments compared to On-Demand pricing.
5. Minimize Cross-AZ Data Transfer
Place application instances in the same AZ as the MemoryDB primary node for write-heavy workloads. Use reader endpoints in each AZ for read traffic to avoid cross-AZ charges on reads.
Related Guides
FAQ
When should I choose MemoryDB over ElastiCache?
Choose MemoryDB when Redis is your primary database and you need data durability (e.g., user sessions, financial transactions, gaming leaderboards). Choose ElastiCache when Redis is a caching layer in front of another database and data loss during failovers is acceptable.
Does MemoryDB have a free tier?
No. MemoryDB does not offer a free tier. The minimum cost is approximately $44/month for a single db.t4g.small node, though production clusters with Multi-AZ replicas start at approximately $640/month.
Can I migrate from ElastiCache to MemoryDB?
Yes. You can migrate by creating a MemoryDB cluster and restoring from an ElastiCache RDB snapshot. The process requires a brief maintenance window. Both services use Redis-compatible APIs, so application code changes are typically minimal.
Lower Your MemoryDB Costs with Wring
Wring helps you access AWS credits and volume discounts to lower your MemoryDB costs. Through group buying power, Wring negotiates better rates so you pay less per node hour.
