Is there any upper limit on the number of members a sorted set in redis can store?

1.4k views Asked by At

Is there any upper limit on the number of members a sorted set in redis can store?

For example, according to this link, 2^32 - 1 different members can only be stored in redis set, list. No such upper limit is mentioned for redis sorted set. So should I assume that, the upper limit depends on the memory that is available or there is a fixed number?

1

There are 1 answers

7
Itamar Haber On BEST ANSWER

The same limit - 2^32-1 - applies to Redis' Sets and Sorted Sets as well.

An excerpt from the Data types page at redis.io:

The max number of members in a set is 232 - 1 (4294967295, more than 4 billion of members per set).

While not mentioned in that page, both Sets and Sorted Sets use the same underlying data structure (which, in turn, is a hash). Hence, they share the same limit.