Redis There are five data structures for , namely :String,Hash,list,set,zset. These five data structures have their own usage scenarios :

1. String
Some IP Addresses are visited frequently over a period of time , It's going to be blocked .Redis Medium String Data types can be accessed through Incrby Command records the number of visits .
2. Hash
Used to store user information [id,name,age];Hset{key,field,value}
for example :Hset{userKey,id,01}
Hset{userKey,name,admin}
Hset{userKey,age,23}
Easy to modify , for example :Hget{userKey,id}
Hset{userKey,id,02}
Why not String Type to store ?
Will userKey The corresponding values are all deserialized , Increased IO frequency , Reduced system performance .
3. List
Can achieve the latest news ranking ; It can also be used List Medium push The command exists the task list In the set , At the same time pop Command to remove the task from the collection .
Redis–List To simulate message queuing 【 This method can be used to complete a seckill activity in e-commerce 】
4. Set
It can discharge the weight automatically .
For example, in the microblog, everyone's friends exist Set In the set , Take the intersection of two people can find two people's common friends .
5. Zset
You can sort with a certain condition as the weight .
For example, the comprehensive ranking of e-commerce , You can also rank prices according to your own needs .

Technology
©2019-2020 Toolsou All rights reserved,
Non preemptive static priority scheduling algorithm for operating system (C language )Go Language learning notes (GUI programming )XCTF Attack and defense world web Advanced practice _ 2_lottery What's the difference between computer major and training background ?python realization vlookup_ Dry goods I : Why python It's inside vlookup Bubble sort primary springboot2 Separation of front and rear platforms ,token Put in header Pit for verification Python Case conversion of letters ( Two methods )javascript event ( Detailed explanation of zero basis )Unity2019 UIElement note ( ten ) Simple exercise 2