redis distributed lock

Overview of distributed locks Before understanding distributed locks, we should first know why distributed locks are used. Let's first understand the following cache exceptions Cache exception Cache penetration It refers to querying a certain nonexistent data. Because the cache does not hit, we will query the database, but the database doe ...

Posted by Morrigan on Thu, 06 Jan 2022 13:17:09 +0100

Detailed analysis of Mybatis cache

Detailed analysis of Mybatis cache 1, Cache cache The purpose of caching is to improve the efficiency of query and reduce the pressure on the database. MyBatis provides level 1 cache and level 2 cache, and reserves an interface for integrating third-party cache. All classes related to cache in MyBatis are in the cache package. There is a ...

Posted by SaxMan101 on Thu, 06 Jan 2022 10:05:20 +0100

Redis - publish and subscribe

1-3 See blog Detailed explanation of Redis - publish and subscribe (Part I) 4 send message When a Redis client executes the PUBLISH command to send a message to the channel, the server needs to perform the following two actions: 1) send message to all subscribers of channel channel. 2) If one or more patterns match the channel, the messa ...

Posted by damo87 on Thu, 06 Jan 2022 09:06:54 +0100

Is Java parameter passing by value or by reference?

preface First of all, it is clear that method parameters in Java are passed by value. For basic types (int a, long b), values are passed when parameters are passed. For example, if int a = 5, 5 is passed. If it is a reference type, pass the address value pointing to the memory address of the specific object, such as system out. Println (New ob ...

Posted by azhan on Thu, 06 Jan 2022 07:24:08 +0100

Master-slave replication & persistence, data types | Cloud computing

1. redis master-slave replication 1.1 problems Specific requirements are as follows: Configure the host 192.168.4.51 as the master serverConfigure the host 192.168.4.52 as the slave server of 192.168.4.51Test configuration 1.2 scheme Deploy the redis master-slave replication structure and the host role, as shown in figure-1: Figure ...

Posted by NixNod on Thu, 06 Jan 2022 00:28:11 +0100

Event driven framework in Redis

Event driven framework in Redis In the previous article, I learned the basic working mechanism of Redis event driven framework, introduced the Reactor model based on the event driven framework, and took the client connection event in the IO event as an example to introduce the basic process of the framework: calling the aeCreateFileEvent funct ...

Posted by ianr on Wed, 05 Jan 2022 06:47:03 +0100

Use Redis to make your interface automatically idempotent

1, What is interface idempotency Idempotency is that the results of only multiple operations are consistent. Someone here may have questions. Q: why should the results of multiple operations be consistent? For example, when I query data, what I find out is the same every time. Even if I modify it, should it be the same every time? A: by mult ...

Posted by byrt on Tue, 04 Jan 2022 22:32:00 +0100

Spring Security: user service UserDetailsService source code analysis

In the previous blog, the blogger introduced the UserDetails interface of Spring Security and its implementation. Spring Security uses the UserDetails instance (the instance of the implementation class) to represent the user. When the client authenticates (provide the user name and password), Spring Security will obtain the corresponding UserDe ...

Posted by Matth_S on Tue, 04 Jan 2022 21:27:20 +0100

Redis publish / subscribe

Redis implements the publish / subscribe function, and developers can quickly carry out scenario applications through this lightweight function. SUBSCRIBE,UNSUBSCRIBE and PUBLISH Realized Publish / subscribe messaging paradigm , this decoupling between publishers and subscribers can achieve greater scalability and more dynamic network topology. ...

Posted by jeremyphphaven on Tue, 04 Jan 2022 19:15:55 +0100

Principle of redisson MultiLock and application of distributed lock

1, Foreword Redisson distributed interlocking RedissonMultiLock objects based on Redis can associate multiple RLock objects into an interlocking, and each RLock object instance can come from different redisson instances. Of course, this is the introduction of the official website. What is it? Let's take a look at the use and source code of int ...

Posted by JustinM01 on Tue, 04 Jan 2022 15:25:42 +0100