“This is the third day of my participation in the Gwen Challenge in November. Check out the details: The last Gwen Challenge in 2021.”
List types
- List types are what we think of in Java
LinkedList
- We can do it at
Hope primary school
Insert six students in - You can also insert it directly on the right
- We can do it at
- analogy
LinkedList
, we can use commands such asLPUSH
/RPUSH
/LINSERT
- The performance of traversing a list in Redis also deteriorates as the index grows
- Interval problems can be traversed by using start and stop intervals during traversal
Hash type (dictionaryhash
)
- One in the dictionary
key
Can store more than onevalue
- Such as using the
hset
- If you have
key
Fixed, deposit the samevalue
The internal will automatically do an unsuccessful insert and return changed0
line
- Such as using the
Set (set)
- analogy
hash
.redis
In theset
similarjava
In theHashSet
- in
redis
Use the command insadd
- for
set
One of the best applications is to remove functionality - When we repeatedly insert
value
Will automatically save this for usvalue
, as shown in the figure below
- in
Sorted set (sorted set)
- The inside of the ordered set isJump tableimplemented
- The main application is when we want to sort data
- So is the inner thought of the skip table
- As shown in the figure below
- We have enumerated all five basic data structures
string
(String)/list
(list) /hash
(zidian )/set
/ (collection)zset
(Ordered set)
Basic data types are extremely important and will be introduced later along with other advanced features and some application scenarios 😊