What is a Key-Value Database?

A key-value database (sometimes called a key-value store) uses a simple key-value method to store data. These databases contain a simple string (the key) that is always unique and an arbitrary large data field (the value). They are easy to design and implement.

An Example of Key-value database

As the name suggests, this type of NoSQL database implements a hash table to store unique keys along with the pointers to the corresponding data values. The values can be of scalar data types such as integers or complex structures such as JSON, lists, BLOB, and so on. A value can be stored as an integer, a string, JSON, or an array—with a key used to reference that value. It typically offers excellent performance and can be optimized to fit an organization’s needs. Key-value stores have no query language but they do provide a way to add and remove key-value pairs. Values cannot be queried or searched upon. Only the key can be queried.

A simple example of key-value data store.

When to use a key-value database

  • When your application needs to handle lots of small continuous reads and writes, that may be volatile. Key-value databases offer fast in-memory access. 
  • When storing basic information, such as customer details; storing webpages with the URL as the key and the webpage as the value; storing shopping-cart contents, product categories, e-commerce product details
  • For applications that don’t require frequent updates or need to support complex queries.

Use cases for key-value databases

  • Session management on a large scale.  
  • Using cache to accelerate application responses.
  • Storing personal data on specific users.
  • Product recommendations, storing personalized lists of items for individual customers.
  • Managing each player’s session in massive multiplayer online games.

Redis Enterprise

Redis Enterprise is a robust in-memory database platform built by the people who develop open source Redis. It maintains the simplicity and high performance of Redis, while adding many enterprise-grade capabilities, such as linear scaling to hundreds of millions of operations per second, Active-Active geo-replication with local latency, Redis on Flash to tier data across dynamic and persistent memory and solid-state disk (SSD) to reduce total cost of ownership, and five-nines (99.999%) uptime based on built-in durability and single-digit-seconds failover. Redis Enterprise supports many data modeling methods with modules such as RediSearch, RedisJSON, RedisGraph, RedisTimeSeries, RedisBloom, and RedisAI, and allows operations to be executed across and between modules and core Redis functionality using RedisGears, a serverless engine that runs across shards and nodes of Redis Enterprise cluster. All this while keeping database latency under one millisecond, so your application can respond instantaneously.

Next section  ►  Document databases