Five data types of Redis

Redis supports 5 data types.

 

String String


 

 

Hash / Hash Hash

Redis hashes/Hashes are collections of key-value pairs.



 

 

List List

Redis lists are just lists of strings, sorted by insertion order. You can add elements to the head or tail of a Redis list.


Example of Jedis operating Redis List: http://huangqiqing123.iteye.com/blog/2390948

 

 

Collection Set

A Redis collection is an unordered collection of strings. There cannot be duplicate values ​​in the collection. The same value can be placed in the same collection multiple times (no error will be reported), but there is always only one value in the collection.



 

 

 

 

Sortable collection ZSet

ZSet is similar to Set, which is a set of non-repeating characters. The difference is that each member of the Zset is associated with a score, which is used for a sorted set ordered from the smallest score to the largest score.

In the same Zset collection, when elements with the same value are placed, the elements placed later will overwrite the elements placed first (value + score).



 

 

 

 

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326242613&siteId=291194637