• Analysis of del of redis command


    baiyan Command syntax Command meaning: delete the value corresponding to a keyCommand format: DEL [key1 key2 …] Command actual combat:> del key1 (integer) 1 Return value: the number of deleted keys Source code analysis First, we open a redis client and use the port of GDB – P redis server. Since the processing function […]

  • Analysis of dump of redis command


    Grape Official documents DUMP keySerialize the given key and return the serialized value. Use the restore command to deserialize the value to the redis key.The values generated by serialization have the following characteristics: It has 64 bit checksums for error detection, and restore checks the checksums before deserializing. The encoding format of the value is […]

  • How to realize the function of robbing red packets through the script Lua of redis


    Redis script introduction Redis starts from version 2.6 and supports Lua environment through embedded benefit Reduce network overhead. Multiple requests can be sent in the form of scripts at one time to reduce network delay Atomic operation. Redis will execute the whole script as a whole, and it will not be inserted by other commands […]

  • Using redis to realize the ranking function of wechat steps


    1. Preface I wrote a blog before, which explained the five data structures of redis and their common commands. At that time, readers commented that they wanted to understand the use scenarios of the five data structures, but they didn’t have time to write. As it happens, when I was interviewing for a job in […]

  • Summary of redis data deletion strategy and eviction algorithm


    Data storage and validity stayredis In workflow, expired data does not need to be deleted immediately. Because these deletions are only a state representation, you canasynchronousTo deal with, when not busy to do these not urgent delete operations, so as to ensureredisHigh efficiency Data storage In redis, data storage not only needs to save the […]

  • [redis5 source code learning] analysis of keys of redis command


    baiyan Command syntax Command meaning: find and return all the keys that match the given pattern patternCommand format: KEYS pattern Command actual combat:> keys * 1) “kkk” 2) “key1” Return value: the set of all keys matched according to pattern Source code analysis The corresponding processing function of keys command is keyscommand(): void keysCommand(client […]

  • [redis5 source code learning] analysis of the expire part of redis command


    Grape Command syntax Command meaning: set the time to live for a given key. When the key expires (the time to live is 0), it will be deleted automatically.Command format: EXPIRE key seconds Command actual combat: redis> EXPIRE cache_ Page 30000 update expiration time (integer) 1 Return value: Setting successfully returned 1.When the key does […]

  • Example of redis basic installation judgment and startup usage


    The example of this paper describes the basic installation judgment and startup usage of redis. To share with you for your reference, as follows: 1. Whether redis is installed (the following corresponding code will appear after installation) [root]$ whereis redis-cli redis-cli: /usr/local/bin/redis-cli [root]$ [root]$ whereis redis-server redis-server: /usr/local/bin/redis-server 2. Start redis Enter code redis-server & […]

  • Implementation and analysis of spring boot redis cache data


    This article mainly introduces the implementation and analysis of spring boot redis cache data. The example code is introduced in detail in this article, which has a certain reference learning value for your study or work. You can refer to the following for friends who need it 1. Enable cache support Spring supports caching in […]

  • Summary of redis data types and application scenario knowledge points


    Redis data types and application scenarios Redis supports five data types: string, hash, list, set and Zset (sorted set). 1、 String Introduction: strings data type is the most common and simple key value type. Ordinary key / value storage can be classified into this type. Value can be either a string or a number. Because […]

  • Summary of the correct implementation of redis distributed lock


    There are generally three ways to implement distributed locks: 1. Database optimistic lock; 2. Redis based distributed lock; 3. Distributed lock based on zookeeper. This article will introduce the second way, which is to implement distributed lock based on redis. Although there are various blogs about the implementation of redis distributed lock on the Internet, […]

  • Redis profile code explanation


    Redis configuration files are available on the Internet. I won’t go into details here. Provide some parameters worthy of modification, especially those marked in red, otherwise it is easy to have master-slave full synchronous dead cycle NETWORK Bind is bind by default, which is commented out Protected mode no default protected mode yes, […]