Skip to content
Theory · Redis: Data Structures, TTL, Eviction · lesson 1 of 12

Keys and strings

A magnetic board: the keys menu:4, cart:anna and promo:day hold a card with fields, a strip of tickets and a note; the ledger is far away

The price ledger from the MVCC chapter lies in the back office. It has everything, but every lookup means a walk there. So a magnetic board hangs at the barista's counter. It holds only what is needed right now: how many orders came in today, the deal of the day, the queue of tickets. A glance at the board takes a second, a trip to the back office a minute.

In this lesson

  • The keyspace
  • Strings
  • Counters and INCR
  • Redis and Valkey
  • Common mistake
  • Key points