Comparing key-value stores
Four stores that all map keys to values — and almost nothing else in common.
Redis, Memcached, DynamoDB, and etcd all expose a simple key-to-value interface but target very different jobs. Redis is a rich in-memory data-structure server with optional persistence; Memcached is a bare, blazing-fast volatile cache; DynamoDB is a fully managed, massively scalable persistent store; etcd is a small, strongly-consistent store for configuration and coordination. Pick by persistence, data model, scale, and consistency needs.
Persistence
The first dividing line is whether data survives a restart. Memcached is purely volatile — lose the process and the cache is gone, which is fine because it only holds disposable copies. Redis keeps data in memory but can persist to disk via snapshots or an append-only log, while DynamoDB and etcd are disk-backed stores that treat your data as durable by default.
Data structures
Redis stands apart by storing typed data structures — strings, hashes, lists, sets, sorted sets, bitmaps, and streams — with atomic operations on each, so it can act as a leaderboard, queue, or rate limiter, not just a cache. Memcached stores only opaque byte values against keys, deliberately minimal. DynamoDB offers items with attributes and secondary indexes, and etcd stores plain versioned key-value pairs meant for small configuration data.
Scale
DynamoDB is the scale champion: as a managed service it partitions data across AWS infrastructure to deliver effectively unlimited throughput and storage with single-digit-millisecond latency. Redis and Memcached scale by clustering and sharding across nodes, bounded by available RAM. etcd deliberately stays small — its consensus overhead means it is sized for kilobytes-to-megabytes of critical metadata, not bulk data.
Consistency
etcd is the consistency specialist: it uses the Raft consensus algorithm so a majority of nodes must agree before a write commits, giving strong, linearizable guarantees — exactly what leader election and configuration demand. DynamoDB defaults to eventual consistency for speed and scale but lets you request strongly consistent reads per query. Redis and Memcached prioritize speed, offering asynchronous replication where replicas can briefly lag.
Typical use
Reach for Redis when you need a fast cache plus data structures for sessions, queues, leaderboards, or rate limiting. Reach for Memcached when you want the simplest possible high-throughput cache and nothing more. Reach for DynamoDB when you need a serverless primary datastore that scales without operational effort, and for etcd when infrastructure needs a rock-solid source of truth for configuration and coordination.
What key-value stores are and why they differ
A key-value store is the simplest database shape imaginable: you associate a unique key with a value and retrieve the value by its key, like a giant dictionary or hash map. That minimal interface is the source of both their speed and their variety — because the model imposes so little, implementations are free to make wildly different choices about where data lives, how durable it is, how far it scales, and how consistent it stays.
The trap is treating "key-value store" as one category. Redis, Memcached, DynamoDB, and etcd all fit the definition, yet you would rarely swap one for another. The useful way to compare them is along four axes: persistence (does data survive a crash?), data model (opaque bytes or rich structures?), scale (how big can it get?), and consistency (how strong are the guarantees when nodes disagree?). Almost every real decision between these tools comes down to where a workload sits on those four axes, so that is the frame this comparison uses.
Redis — the in-memory data-structure server
Redis keeps its entire dataset in RAM, which is why reads and writes take microseconds. But calling it a cache undersells it: Redis is a data-structure server. Alongside plain strings it offers hashes, lists, sets, sorted sets, bitmaps, hyperloglogs, and streams, each with atomic server-side operations. That means Redis can be a leaderboard (sorted sets), a job queue (lists or streams), a rate limiter (counters with expiry), a session store, or a pub/sub bus — not just a place to stash query results.
Although it lives in memory, Redis is not necessarily volatile. It offers persistence via periodic RDB snapshots and an AOF (append-only file) that logs every write, so a restart can rebuild state. It supports replication (primary/replica) and Redis Cluster for sharding across nodes, bounded ultimately by available memory. The trade-off is cost and capacity: RAM is expensive, so Redis is best for hot, high-value data and rich operations rather than storing everything. When you need speed *plus* smart data operations, Redis is usually the answer.
Memcached — the minimalist cache
Memcached is Redis's older, simpler cousin, and its whole philosophy is to do one thing extremely well: cache small blobs of data in memory, fast. It stores opaque values against keys — no lists, no sorted sets, no server-side data structures — and it is purely volatile, meaning there is no persistence at all. If the process restarts, the cache is empty, which is perfectly acceptable because a cache only ever holds disposable copies of data whose source of truth lives elsewhere.
What Memcached offers in return for that minimalism is raw throughput and simplicity. It is multithreaded, so it can saturate many CPU cores on a single node, and its tiny feature surface means very little can go wrong operationally. You scale it by running more instances and sharding keys across them client-side.
The choice between Memcached and Redis is a genuine one: pick Memcached when you want the simplest, highest-throughput volatile cache and truly need nothing more than get/set on strings. Pick Redis the moment you want persistence, replication, or any of its data structures — which, in practice, is most of the time, which is why Redis has become the more common default.
DynamoDB and etcd — opposite ends of the spectrum
DynamoDB is Amazon's fully managed key-value (and document) database, and it sits at the opposite end from Memcached: it is disk-backed, durable, and built to scale almost without limit. You never manage servers; AWS transparently partitions your data across its infrastructure to deliver single-digit-millisecond latency at effectively any throughput you provision or let it autoscale to. By default it favors eventual consistency — a read may briefly not reflect the latest write — because that is what lets it scale so far, but you can request a strongly consistent read per query when correctness matters more than a few milliseconds. DynamoDB is a *primary datastore*, not a cache: teams build entire applications on it, designing their access patterns and partition keys carefully around its model.
etcd is smaller than any of them by design, and that is the point. It is a strongly consistent, disk-backed key-value store that uses the Raft consensus algorithm: a write is only committed once a majority of its nodes agree, giving linearizable guarantees. That makes etcd the trustworthy source of truth for configuration and coordination — leader election, service discovery, distributed locks, and cluster state. Kubernetes stores its entire cluster state in etcd for exactly this reason. The consensus overhead means etcd is sized for small, critical metadata, never bulk data.
Choosing between them
Because these four stores share an interface but almost nothing else, choosing well means matching the workload to the four axes:
- Need a fast cache with smart operations? Redis — sessions, leaderboards, queues, rate limiting, plus optional persistence.
- Need the simplest, fastest possible volatile cache and nothing else? Memcached.
- Need a serverless primary datastore that scales huge with zero ops? DynamoDB — great for high-scale web and mobile backends where you can design around its key model.
- Need a small, rock-solid source of truth for configuration or coordination? etcd — where strong consistency matters far more than throughput.
The deeper lesson is that "it's just a key-value store" tells you very little. The interface is trivial; the engineering behind persistence, data structures, scale, and consistency is where all the real differences — and all the real decisions — live. Name your non-negotiable axis first, and the right store usually becomes obvious.
Redis: in-memory, rich data structures (lists, sets, sorted sets, streams), optional persistence and replication.
Memcached: in-memory, values-only, multithreaded and extremely simple — a pure volatile cache with no persistence.
DynamoDB: AWS-managed, disk-backed, virtually unlimited horizontal scale with tunable read consistency.
etcd: small, disk-backed, strongly consistent via the Raft consensus algorithm — built for config and coordination.
Choose on four axes: persistence, data model richness, scale ceiling, and consistency guarantees.
Redis and Memcached cache to relieve databases; DynamoDB is a primary datastore; etcd is infrastructure's source of truth.
Quick quiz
Which store is purpose-built for strongly consistent configuration and coordination?
What most distinguishes Redis from Memcached?
Redis vs Memcached
Two in-memory key-value stores — one a lean cache, one a data-structure server.
Database types you should know
A field guide to the eight database families and when each one wins.
Which database should I use on AWS
Seven managed engines, one rule — match the database to the shape of your data and access pattern.
The life of a Redis query
Follow one command from your client to a reply — and see why single-threaded is a feature, not a bug.