โ† Redis learning path
Redis ยท Module 2 of 10

Strings and keys

Strings are the simplest Redis type; keys can expire on their own.

๐Ÿ“– Key ideas

  1. SET name value stores a string; GET name reads it.
  2. INCR and DECR change numbers atomically, great for counters.
  3. EXPIRE key seconds (or SET ... EX) makes a key delete itself later.
  4. TTL key shows how many seconds are left.
  5. Use clear key names like user:42:name.
๐Ÿ’ก Real-life example: Like a sticky note with a self-destruct timer: it tells you the value, then disappears when its time is up.
SETStore a value under a key
GETRead the value of a key
INCRAdd one to a number atomically
TTLSeconds left before a key expires