DatabaseApr 20263 min read

Redis vs DynamoDB — When Your Cache Grows Up

Redis is your speedy in-memory sidekick; DynamoDB is the serverless database that scales without you lifting a finger. Pick based on whether you need a cache or a core data store.

The short answer

DynamoDB over redis for most cases. DynamoDB wins because it’s fully managed and scales automatically to petabytes without operational overhead.

  • Pick redis if need sub-millisecond latency for ephemeral data, like caching API responses or powering a real-time leaderboard
  • Pick dynamodb if you’re building a serverless app on AWS and want a durable, auto-scaling database for core data without managing servers
  • Also consider: **MongoDB Atlas** if you need rich querying and document flexibility without DynamoDB’s key-value constraints, but be ready for more configuration.

— Nice Pick, opinionated tool recommendations

Different Philosophies, Different Weight Classes

Redis and DynamoDB aren’t direct competitors—they’re tools for different jobs. Redis is an in-memory data structure store, optimized for speed and ephemeral data like caching, session storage, or real-time leaderboards. DynamoDB is a NoSQL database built for durability and massive scale, handling persistent data with single-digit millisecond latency. Think of Redis as a sports car: fast but limited trunk space. DynamoDB is a freight train: slower off the line, but it’ll haul anything across continents without breaking a sweat.

Where DynamoDB Wins

DynamoDB’s killer feature is automatic scaling. You define your capacity (or use on-demand), and AWS handles partitions, replication, and failover. It scales to petabytes with no downtime, and you pay only for what you use (starting at $0.25 per million write units). For persistent, structured data—like user profiles, product catalogs, or event logs—DynamoDB is set-and-forget. Its global tables replicate data across regions in under a second, making it a no-brainer for multi-region apps. Plus, it integrates natively with AWS services like Lambda, reducing glue code.

Where Redis Holds Its Own

Redis excels at sub-millisecond latency for read-heavy workloads. Need to cache database queries or store real-time analytics? Redis delivers 100,000+ operations per second on modest hardware. Its rich data types—like sorted sets for rankings or pub/sub for messaging—make it versatile beyond simple key-value stores. Tools like RedisJSON and RediSearch add document storage and full-text search, blurring the line between cache and database. For use cases where speed trumps durability (e.g., gaming leaderboards, rate limiting), Redis is unbeatable.

The Hidden Friction: Durability and Management

Redis’s in-memory nature is a double-edged sword: lose power, lose data. Yes, you can persist to disk with AOF or RDB, but that adds complexity and latency. Running Redis at scale means managing clusters, replication, and failover yourself—or paying for managed services like AWS ElastiCache (which starts at $0.022/hour for a t3.micro). DynamoDB, by contrast, is durable by default with 99.999% availability SLA. The gotcha? Its query model is limited to primary key lookups and GSIs; complex joins require denormalization or secondary services. Switching from Redis to DynamoDB means rewriting data access patterns, not just swapping drivers.

If You’re Starting Today...

Ask one question: Is this data ephemeral or permanent? For caching, session stores, or real-time features, use Redis. Spin up ElastiCache if you’re on AWS, or Redis Cloud for a managed experience. For core application data—user accounts, orders, logs—use DynamoDB. Its serverless model means you won’t get paged at 3 AM because traffic spiked. Start with on-demand pricing, and switch to provisioned capacity once you understand your patterns. Ignore the hype: pick the tool that matches your data’s lifespan.

What Most Comparisons Get Wrong

Most reviews treat these as interchangeable NoSQL stores. They’re not. Redis is a cache that grew features; DynamoDB is a database built for the cloud. The real question isn’t “which is faster?”—Redis wins on raw speed—but “which reduces operational toil?” DynamoDB abstracts away servers, patches, and scaling. Redis gives you control at the cost of management. If you’re comparing latency numbers, you’re missing the point: DynamoDB lets you sleep at night, Redis lets you optimize for performance. Choose your trade-off.

Quick Comparison

Factorredisdynamodb
Data ModelIn-memory key-value with rich types (strings, lists, sets)NoSQL key-value and document store
PricingSelf-hosted free; AWS ElastiCache from $0.022/hourOn-demand: $0.25 per million write units, $0.10 per million read units
DurabilityOptional persistence (AOF/RDB), data loss risk on failureAutomatically replicated across 3 AZs, 99.999% availability SLA
Max Throughput100,000+ ops/sec per node, scales horizontally with clusteringUnlimited with on-demand, 40,000 read units/sec per partition (provisioned)
LatencySub-millisecond for in-memory operationsSingle-digit milliseconds for most operations
Managed ServiceAvailable (e.g., ElastiCache, Redis Cloud), but requires node sizingFully serverless, auto-scaling, no infrastructure management
Query FlexibilityLimited to key lookups; extensions like RediSearch add complexityPrimary key and GSI queries only, no SQL or joins
Use Case Sweet SpotCaching, real-time analytics, session storagePersistent application data, high-scale OLTP workloads

The Verdict

Use redis if: You need sub-millisecond latency for ephemeral data, like caching API responses or powering a real-time leaderboard.

Use dynamodb if: You’re building a serverless app on AWS and want a durable, auto-scaling database for core data without managing servers.

Consider: **MongoDB Atlas** if you need rich querying and document flexibility without DynamoDB’s key-value constraints, but be ready for more configuration.

🧊
The Bottom Line
DynamoDB wins

DynamoDB wins because it’s fully managed and scales automatically to petabytes without operational overhead. Redis requires babysitting for production workloads.

Related Comparisons

Disagree? nice@nicepick.dev