AlgoViz

Key-value database

easy 24 min

A key-value database stores a value under a unique name and returns it when you give that name back.

Where it shows up

The same pattern appears across everyday software.

  • Facebook and Memcached

    A 2013 USENIX paper by its engineers describes a very large caching layer built from Memcached in front of its databases.

  • Kubernetes and etcd

    The Kubernetes documentation calls etcd the consistent and highly available key-value store for all API server data.

  • Amazon and DynamoDB

    AWS names the Amazon.com sites, Alexa and all Amazon fulfilment centres as users of DynamoDB.

  • Login sessions

    The cookie carries a random id; the store returns the user and drops the entry after its lifetime.

  • Game leaderboards

    A sorted set keeps players by score. Adding a score and reading a rank are small steps.

  • One-time codes

    A six-digit code is stored under the phone number for five minutes and removed on first use.