Redis supports several different data types that allow you to store a variety of data structures. As of the latest Redis versions, the primary data types include:
-
Strings:
- The simplest type, storing text or binary data up to 512 MB in size.
- Examples:
"Hello, World!"
,"12345"
,"\x00\x01\x02"
-
Lists:
- Ordered collections of strings.
- Implemented as linked lists, allowing operations like
LPUSH
,RPUSH
,LPOP
,RPOP
, andLRANGE
. - Example:
["apple", "banana", "cherry"]
-
Sets:
- Unordered collections of unique strings.
- Support operations like
SADD
,SREM
,SPOP
,SMEMBERS
, and set operations like