1.string
Deposit session,session Store user's basic information , login time , user name ,vtypes,utypes; It is associated with the need for independent expiration time key Can be used string, such as mongo Of “ Function lock ”, For example, the general pop-up window needs to determine whether it has been played before ,mongo Lack of transaction similarity in itself select
for update Support for , So we'll use one redis Lock to determine whether there is a pop-up request in execution ;
2.hash surface
Has a common prefix , There is no independent overdue demand key, It can be used hash replace string, Can save memory and reduce string Of key easy redis recovery ; For example, the administrator can apply three times a day , The number of misjudgment of each administrator should not exceed 5 etc. , They are all big hash, For example police_daily_order_20180930, And then uid And the number of applications k
v; Trigger the script every night and delete it after saving ;
3.list
There are basically no use scenarios , For example, some people in the fresh stream and message queuing group think about it , Needless to say, the fresh stream is too troublesome to delete , Message queues are mainly redis The news of expensive memory and fear of not consuming in time ; Also want to use to control the second kill does not burst warehouse , If there is no personalized demand for each product, use it directly decrby That's fine ;
4.set
Never used it
5.zset
pvt For Leaderboard ;
6.hyperloglog
I've heard from grape that I used this statistic before uv, Number of machines ,ip Number, etc , And then he did it ;
Technology
Daily Recommendation