Key-Value Store
Definition
Simple database model that stores data as key-value pairs. Like having a giant dictionary where you can look up any value using its unique key.
Use Cases
- Amazon: Shopping cart and session-like state for high-traffic e-commerce experiences — Amazon DynamoDB is commonly used within AWS-based architectures to store items keyed by identifiers (for example, user or cart IDs) to enable low-latency reads/writes at very high request rates. (Enables consistent, low-latency access at scale and reduces operational overhead compared to self-managed databases.)
- Netflix: Low-latency user personalization and application data lookups — Netflix has publicly discussed using Apache Cassandra (a distributed NoSQL database that supports key-based access patterns) to store and retrieve data by keys across globally distributed systems. (Supports high availability and horizontal scalability for large volumes of reads/writes in production services.)
- Google: Large-scale, low-latency key-based access for time-series and operational data — Google Cloud Bigtable is used for workloads that need fast lookups by row key and high throughput, commonly for time-series, monitoring, and analytics pipelines. (Handles very large datasets with predictable low-latency access and scales horizontally with managed operations.)
Provider Equivalents
- AWS: Amazon DynamoDB
- Azure: Azure Cosmos DB (Table API)
- GCP: Cloud Bigtable
- OCI: OCI NoSQL Database
Frequently Asked Questions
- What's the difference between a key-value store and a relational database?
- A key-value store retrieves data using a single unique key (like looking up a value in a dictionary). A relational database stores data in tables with rows and columns and supports complex queries (joins, aggregations, flexible filtering). Key-value stores are usually faster and simpler for direct lookups, while relational databases are better for rich querying and strong relational constraints.
- When should I use a key-value store?
- Use a key-value store when your access pattern is mostly "get by key" and "put by key" and you need very low latency and easy scaling. Common uses include session storage, caching user profiles or preferences, shopping carts, feature flags, rate limiting counters, and storing tokens or API keys. Avoid it when you need complex queries across many fields or frequent joins.
- How much does a key-value store cost?
- Cost depends on (1) read/write request volume, (2) data stored (GB), (3) replication and backup features, and (4) provisioned vs on-demand capacity (where applicable). Managed services typically charge for storage plus operations/throughput, and may add costs for backups, multi-region replication, and network egress. A good estimate starts with expected requests per second, average item size, and retention period.
Category: data
Difficulty: basic
Related Terms
See Also