Home >Database >Redis >How many keys can redis store?

How many keys can redis store?

anonymity
anonymityOriginal
2019-06-05 10:05:2814922browse

Redis is a high-performance key-value database. The emergence of redis has largely compensated for the shortcomings of key/value storage such as memcached, and can play a very good supplementary role to relational databases in some situations. It provides Java, C/C, C#, PHP, JavaScript, Perl, Object-C, Python, Ruby, Erlang and other clients, which is very convenient to use.

How many keys can redis store?

#How many keys can redis store?

Officially said that a single instance can handle 250 million keys, reference link: https://redis.io/topics/faq, the following is the original words:

What is the maximum number of keys a single Redis instance can hold? and what the max number of elements in a Hash, List, Set, Sorted Set?

Redis can handle up to 2^32 keys, and was tested in practice to handle at least 250 million keys per instance.

Every hash, list, set, and sorted set, can hold 2^32 elements.

In other words your limit is likely the available memory in your system.

Recommended ManualRedis Command Operation Chinese Manual

The storage capacity of different data types will be different:

Original address: https://redis.io/topics/data-types

Strings type: A String type value can store up to 512M

Lists type: The maximum number of elements in the list is 2^32-1, which is 4294967295.

Sets type: The maximum number of elements is 2^32-1, which is 4294967295.

Hashes type: The maximum number of key-value pairs is 2^32-1, which is 4294967295.

Sorted sets type: similar to Sets type.

Recommended related articles:
1.How many keys can a redis instance store
2.Redis determines whether the key exists
Related video recommendations:
1.Yan Shiba redis video tutorial

The above is the detailed content of How many keys can redis store?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn