Chapter 2. Advanced Data Types (Earning a Black Belt)

This chapter introduces the Set, Sorted Set, Bitmap, and HyperLogLog data types. It is a continuation from the previous chapter, and it also introduces new commands through redis-cli and Node.js, along with some details of the internals of each data type.

Sets

A Set in Redis is an unordered collection of distinct Strings—it's not possible to add repeated elements to a Set. Internally, a Set is implemented as a hash table, which is the reason that some operations are optimized: member addition, removal, and lookup run in O(1), constant time.

The Set memory footprint will be reduced if all the members are integers, and the total number of elements can be as high as the value of the set-max-intset-entries ...

Get Redis Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.