Redis basic data

 

Redis

       Redis is a very fast non-relational databases (NoSql), which can store the mapping between the key (key) and five different values ​​(value). Memory key-value store of data can be persisted to disk.

 

Redis data structures

       Redis can store the mapping between keys and 5 different types of data structures, these five kinds of data structure types into STRING (a string), the LIST (list), the SET (set), the HASH (hash) and zset (there ordered set). There are five kinds of structure for the part of the general instruction, such as DEL, TYPE, RENAME, etc.; Redis but there is a command can be treated using one or two structures.

 

       1. String

       String has a key-value store and other similar commands such as GET (acquisition value), SET (set value), DEL (delete value).

 

 

       2. List

       Redis lists many languages ​​and may perform operations which is similar to a list of actions: LPUSH, RPUSH the element are pushed into the list with left and right ends; LPOP, RPOP command for ejecting element respectively from left and right ends of the list; for LINDEX Get a list of elements on a given position; LRANGE for obtaining a list of all the elements on a given range;

 

 

 

 

 

       3. collection

       Redis collection, the list may store a plurality of strings, except that the same list can store a plurality of strings, and set by using a hash table to ensure that each character string stored in itself is different from each other.

 

 

 

 

       4. Hash

       Redis hash may store the mapping between a plurality of pairs. And string as a hash value stored in the string and can be either a numeric value. Value and the user can also perform the self-energizing operation or the operation of the digital self hash stored.

 

 

       5. ordered set

       Ordered set and the same hashing, key-value pair is used to store: the ordered set is called key members, each member is different; the values ​​of the ordered set is called a score, the score must be floating point. Redis ordered set is the only one that is inside the members can access the elements, and can be accessed elements based on the sort order of scores and scores of structures.

 

Guess you like

Origin www.cnblogs.com/jxl123456/p/11074153.html