Summary of Redis learning notes
1. Redis transaction
1.1 role of redis transaction
Redis transaction is a separate isolation operation. All commands in the transaction will be serialized and executed sequentially (because of single thread + IO multiplexing). During the execution of the transaction, it will not be interrupted by the command request sent by other client ...
Added by gdure on Thu, 17 Feb 2022 22:48:32 +0200
Lua script quick start (with sample program code)
Lua scripts quick start
Lua is case sensitive
premise
After Lua is installed on this machine, the installation steps of lua can be completed
Basics
notes
-- This is a single line comment
-- [[
This is a multiline comment
This is a multiline comment
-- ]]
Reserved keywords
Reserved keyword document address
variable
Type when ...
Added by moberemk on Sun, 19 Dec 2021 19:04:12 +0200
Using Redis to implement the cut-to-program operation
This project is a Spring boot project
Redis Cutting Programming
Target: Add a comment to the method to cache when querying
Method: Custom Note+AOP Section Programming
step
Say nothing but go directly to the code demonstration
Step One
Definition Notes
@Retention(RetentionPolicy.RUNTIME)
@Target( ...
Added by Bad HAL 9000 on Tue, 23 Jun 2020 05:27:47 +0300
How to Design High Performance Distributed Locks
What is a distributed lock?
In a JVM, where multiple threads are concurrent, we can use synchronous or Lock locks to ensure that only one thread can modify shared variables or execute code blocks at a time.However, our services are deployed on a distributed cluster basis, and for some shared resources, the use of Java locks in a distributed en ...
Added by gersh on Wed, 17 Jun 2020 19:51:19 +0300
Resource release of Redis
Write in front
see GitHub for all sample codes in this tutorial: https://github.com/selfconzrr/Redis_Learning
Why close the connection?
For example, the following code:
for(int i = 2000; i < 3000; i++) {
Jedis jedis = redisDao.getJedis();
jedis.set("user:" + i, jedis.toString());
System.o ...
Added by André D on Mon, 01 Jun 2020 20:42:26 +0300
Java seckill system-2.7-jedis redis.clients.jedis.exceptions.jedisconnectionexception: problem solving
1. application.properties
#thymeleaf
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
spring.thymeleaf.cache=false
spring.thymeleaf.content-type=text/html
spring.thymeleaf.enabled=true
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.mode=HTML5
# mybatis
mybatis.type-ali ...
Added by flhtc on Sun, 26 Jan 2020 16:53:35 +0200
Spring boot2.x and redis reduce integrated operation redis cluster case
scene
After a machine crashes in the redis cluster, the redis of the background service will always report an error and cannot connect to the redis cluster. View the redis cluster through the command. It is found that the redis cluster cluster is normal. The standby slave machine has been upgraded to master.
Conjecture and verification
It is pr ...
Added by wudiemperor on Wed, 08 Jan 2020 16:38:18 +0200
Distributed Lock Implemented by Single-machine redis in springboot
Distributed locks are often required in microservices to perform some tasks.For example, deleting expired data periodically requires only one to execute in multiple services.
The following describes distributed locks in a less rigorous sense, because redis implements distributed locks in a rigorous sense or is more complex, using the following ...
Added by RickyF on Fri, 03 Jan 2020 09:02:48 +0200
Springboot + redis (stand-alone)
This time, I want to share with you that redis is used in spring boot integration. Here, the jedis client of redis is used (here, redis running by docker, please refer to docker quickly builds several common third-party services ), add dependencies as follows:
<dependency>
<groupId>redis.clients</groupId>
<artifact ...
Added by kishanprasad on Thu, 02 Jan 2020 15:07:01 +0200
Redis distributed lock mechanism - technical support for distributed cluster deployment
There are three ways to implement the distributed lock: 1. Optimistic database lock; 2. Redis based distributed lock; 3. ZooKeeper based distributed lock. This blog will introduce the second way to implement distributed locks based on redis. Although there are various blogs about the implementation of redis distributed lock on the Internet, the ...
Added by RealDrift on Fri, 20 Dec 2019 09:50:59 +0200