Chapter

Core data types

Beyond simple text: strings, hashes, lists, sets, and sorted sets, the building blocks Redis gives you.

Redis Basics 5 Lessons from courses

About this chapter

So far a value has been a piece of text. Redis actually gives you several value shapes, each with its own commands. In this chapter you will meet the five core data types and learn when to reach for each one.

Lessons from courses

  1. 1 Strings Redis strings hold text, numbers, or JSON up to 512MB. Learn APPEND, STRLEN, and GETSET with copy-paste redis-cli examples built for developers.
  2. 2 Hashes Redis hashes store many fields under one key, like an object or a row. Learn HSET, HGET, HGETALL, and HDEL with plain redis-cli examples for developers.
  3. 3 Lists Redis lists are ordered collections you can drive as a queue or a stack. Learn LPUSH, RPUSH, LPOP, RPOP, and LRANGE with clear redis-cli examples.
  4. 4 Sets Redis sets hold unique, unordered members and answer membership tests instantly. Learn SADD, SISMEMBER, SINTER, and SUNION with redis-cli examples.
  5. 5 Sorted sets Build a Redis sorted set leaderboard: unique members ranked by score, kept sorted for you. Learn ZADD, ZRANGE, ZREVRANGE, ZSCORE, and ZRANK.
Redis Basics Go to course