Skip to content
BENIBIX Learn

Key-Value Store

Development🗃️ DatabasesNoSQL Databases

Also known as Key-Value Database, KV Store

The simplest NoSQL database. You save a value under a key and read it back.

Think of it like

Think of it like a wall of lockers. Each one has a number, and you open it to get what is inside.

Example

Emma's site keeps each logged-in user's session in a key-value store. The key is the session id, and the value is who they are.

Why it matters

When you only ever look things up by one key, nothing is faster or simpler.

Definition

A key-value store is the simplest kind of NoSQL database. It saves each value under a unique key, like a name tag, and gets it back by that key. It does not look inside the value, so it cannot search by what the value holds. That makes it very fast for simple saves and reads. It is often used for caches, sessions and counters.

Common mistake

Trying to search by what the values contain. A key-value store only finds things by their key.

Key takeaways

  1. 1
    Key in, value out. One lookup, one answer.
  2. 2
    Very fast. No searching inside values.
  3. 3
    Caches and sessions. Its most common jobs.

Compare