🔴 Redis Beginner

What are the five core Redis data types?

Answer

Redis supports five core data types. String: the simplest type, stores text, integers, or binary data up to 512MB — used for caching, counters, and flags. List: an ordered, doubly linked list of strings supporting push/pop from both ends — used for queues, activity feeds, and recent items. Set: an unordered collection of unique strings — used for tags, unique visitors, and social graph relationships. Sorted Set: like a Set but each member has a score (float) and members are ordered by score — used for leaderboards and priority queues. Hash: a map of field-value pairs within one key — used to represent objects like user profiles. Each type has its own set of atomic commands optimized for its use case.