The hash table is also one of the data structures supported by Redis, which uses both redis_encoding_ziplist (compressed list) and redis_encoding_ht (data Dictionary) encoding methods.
When a hash table uses a compressed list, it uses the following structure to store the data (see ZIPLIST.C):
+---------+------+------+------+------+------+------+------+------+---------+| ziplist | | | | | | | | | Ziplist | | ENTRY | Key1 | Val1 | Key2 | Val2 | ... | ... | KeyN | Valn | ENTRY | | HEAD | | | | | | | | | END |+---------+------+------+------+------+------+------+------+------+---------+
When a hash table uses a data dictionary, it uses the following structure to store the data (see DICT.C).
The list is also one of the data structures that Redis supports, encoded using both redis_encoding_ziplist (compressed list) and Redis_encoding_linkedlist (double-ended list).
The collection is also one of the data structures supported by Redis, which uses Redis_encoding_intset (integer set, intset.c) and redis_encoding_ht (data dictionary, dict.c) encoding in two ways, Use Redis_encoding_intset encoding if the first element can be represented as a long long value, otherwise use REDIS_ENCODING_HT encoding. The operation that can be performed on it.
An ordered set (that is, Zset) is also one of the data structures supported by REDIS, encoded using redis_encoding_ziplist (compressed table) and redis_encoding_skiplist (jumping table, zskiplist). It differs from the set in that it adds a score field to the order.
Redis Source Code Analysis (iv): REDIS data type hash table, list, collection, and ordered collection