Key-Value Database
A Key/Value database is a type of [[Non-relational Database|NoSQL]] database that stores data as a table where you have a unique key for each data value.
![[key_value_database_example.png]] “Key/Value data store” by Microsoft.com
[[Redis]] [[Amazon DynamoDB|DynamoDB]] Riak IonDB
- Optimized for simple lookups using the key or a range of keys on a single table.
- Can be very scalable because data can be distributed across multiple machines.
- Not great if you need to query or filter by non-key values.
- Often more expensive than other kinds of databases because they tend to run in-memory.
A key-value database is mostly used when you need to cache data because it is very fast and doesn’t require complex querying.
- Saving user session attributes
- Shopping cart