A Redis production accident cost the company millions

1, Antecedents There is a core project of the company. The client of redis has always used jedis. Later, the technical director asked to replace the jedis client with a more efficient lettuce client, and use the RedisTemplate class of spring framework to operate redis. However, the world is unpredictable. It is such a simple demand that makes ...

Added by HAVOCWIZARD on Thu, 10 Mar 2022 14:48:00 +0200

Redis: basic, data type and version differences (continuous update)

Redis: Basic Recommended java3y: https://mp.weixin.qq.com/s/SdE6MR9g-v93ZtJPme9e8Q 1: What is Redis? Redis is a memory cache database. The full name of redis is: remote dictionary server (remote data service), which is written in C language. Redis is a key value storage system (key value storage system), which supports rich data types, su ...

Added by micbox on Thu, 10 Mar 2022 08:55:07 +0200

Still using RedisTemplate? Try Redis's official ORM framework. It's elegant enough to use

Previously, in the SpringBoot project, I have been using RedisTemplate to operate the data in Redis, which is also the way officially supported by Spring. Compared with Spring Data's support for MongoDB and ES, this way of using Template is really not elegant! Recently, RedisOM, Redis's exclusive ORM framework, has been officially launched by R ...

Added by JustFoo on Thu, 10 Mar 2022 07:49:55 +0200

Solution to invalid spring session configuration serialization for redis

The reason for the problem: after using springsession to automatically add the setting attribute to redis, it will appear hexadecimal garbled code in front of the value. Even if redis serialization configuration is configured, it is useless, because spring session creates a redis itself, and the default is new JdkSerializationRedisSerializer(); ...

Added by mobiuz on Wed, 09 Mar 2022 16:25:54 +0200

[Redis] 4. Explain three special data types in detail: Geospatial, hyperlog and Bitmap

These three special data types are not a new type; The bottom layer is one of the five types; For example: Zset, String 1. Geospatial geographic location geo: geographical location[ ˈ spe ɪʃ l] spatial Positioning of friends, people nearby, taxi distance calculation? Redis's Geo is in redis3 Version 2 is launched! This function c ...

Added by donbonzo on Wed, 09 Mar 2022 12:00:22 +0200

Installation and deployment of centos redis cluster sentinel mode in production environment

1. Turn off the firewall systemctl stop firewalld && systemctl disable firewalld 2. Switch to Alibaba source wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo yum clean all && yum makecache 3. Install gcc yum install gcc gcc-c++ Confirm whether the installation is successful Co ...

Added by grimz on Wed, 09 Mar 2022 09:10:42 +0200

Redis realizes inventory deduction of e-commerce system

In daily development, there are many similar operations of reducing inventory, such as commodity inventory in e-commerce system, prize inventory in lottery system, etc. Solution Using mysql database, use a field to store inventory, and update this field every time you deduct inventory. The database is still used, but the inventory is layere ...

Added by TheOracle on Mon, 07 Mar 2022 20:54:01 +0200

Django project practice ---- realize the logic of sending SMS verification code and verify whether the picture verification code is correct (verification code 2 ends)

To realize the function of sending SMS verification code, we need to use a third-party library. Here we use Ronglian cloud Use Ronglian cloud to build applications Build a new application Just check the SMS verification code After the creation is successful, click application management to view it Account ID and account Token Application ...

Added by run2web on Mon, 07 Mar 2022 15:45:22 +0200

How to solve the oversold problem of high price and high price?

How to solve the oversold problem of high price and high price? A problem caused by second kill The biggest problem of second kill is to solve the problem of oversold. One way to solve oversold is as follows: update goods set num = num - 1 WHERE id = 1001 and num > 0 Let's assume that there is only one item left, and num = 1 in the databa ...

Added by yanjchan on Mon, 07 Mar 2022 10:29:48 +0200

4. Use Redis to optimize login module

#Using Redis to optimize login module Redis is used to optimize the functions with high access frequency that will affect efficiency Use Redis to store verification code [the transfer of external chain pictures fails, and the source station may have anti-theft chain mechanism. It is recommended to save the pictures and upload them d ...

Added by metalhead41 on Sun, 06 Mar 2022 15:55:02 +0200