current location:Home > Technical Articles > Database > Redis

  • What is the method used in Redis key-value design?
    What is the method used in Redis key-value design?
    Irregularities in the use of Redis: The key names stored in Redis are irregular and arbitrary; Redis is used as a repository, there is a risk of data loss, and there is no reloading plan; Redis caches keys without setting an expiration time, and caches low-frequency data occupies a large amount memory, causing the service to crash; Redis caches a large number of bigkeys, which will occupy a large amount of network bandwidth when the application is obtained, and deletion can easily cause congestion; improper use of the Redis client may cause other client connection timeouts. The reason may be that the client password is incorrect and not used. Connection pool, a large number of connection retries lead to system port resource consumption; improper use of Redis client commands leads to a large number of slow queries, affecting other application services
    Redis 949 2023-05-28 16:44:46
  • How to use redis to implement caching in odoo
    How to use redis to implement caching in odoo
    Using Redis to implement caching in Odoo can improve system performance and avoid frequent database queries. The following are the steps to implement Odoo caching using Redis: 1. To install Redis, you first need to install the Redis database. You can refer to the official documentation for installation. 2. Install the PythonRedis module. To use Redis in Odoo, you need to install the PythonRedis module. You can use the pip command to install pipinstallredis3 and configure Odoo. Add the following lines to the Odoo configuration file: redis_host=your_redis_hostredis_port=your_redis_portre
    Redis 1558 2023-05-28 16:40:12
  • How to install redis on Linux system
    How to install redis on Linux system
    Redis is an open source remote dictionary service written in ANSIc language and provides APIs in multiple languages. Once you download the Redis installation package, go to the redis official website to download the reids installation package. The redis official website only provides Linux installation packages by default, so you don’t have to worry about downloading the Windows installation package. The author downloaded redis-3.2.1.tar.gz. The downloaded is the redis source code. You should use the source code installation method to install redis. 2. Install redis\1. Unzip: tar-zxvfredis-3.2.1.tar.gz\2. Enter the decompressed directory and perform the compilation operation: maketest\3. After the compilation test is completed, exit
    Redis 1461 2023-05-28 16:31:06
  • How to implement Redis7.0 deployment cluster
    How to implement Redis7.0 deployment cluster
    Redis7.0 deployment cluster detailed version Cluster architecture: A cluster uses a network to connect several computers and provides a unified management method so that it can present the service effect of a single machine to the outside. The role of the cluster: disperse the access pressure of a single server and achieve Load balancing disperses the storage pressure of a single server to achieve scalability and reduce business disasters caused by the downtime of a single server. 1. Redis cluster internal structure design. Data storage design. Through algorithm design, calculate the location where the key should be saved and allocate all storage space. The plan is to cut it into 16384 parts, and each host saves a part. Each part represents a storage space, not a key storage space. The key is placed in the corresponding storage space according to the calculated results to enhance scalability (there are new
    Redis 1911 2023-05-28 16:28:14
  • How to implement springboot integrated redis sentinel master-slave
    How to implement springboot integrated redis sentinel master-slave
    1. Environment springboot2.3.12.RELEASEJDK1.8IntelliJIDEA development tool Redis sentinel master-slave construction 2. POM file pom file Others are ignored, only the dependencies related to redis are displayed org.springframework.bootspring-boot-starterorg.springframework.bootspring-boot- starter-weborg.springframework.bootspring-boot-starter-data-redisorg.apache.c
    Redis 1498 2023-05-28 16:07:06
  • How to configure multiple databases in Redis
    How to configure multiple databases in Redis
    Preface Redis has databases 0-16 by default. Generally, when we operate redis, we use database 0. However, sometimes our projects want to operate multiple databases at the same time, and we do not want to choose to switch databases every time we access other database data. This is too Cumbersome. Therefore, we need to configure multiple JedisClients, but Jedis are prone to blocking and are not very efficient, so I use LettuceClient, which is a Reactive connection method and is relatively efficient. But how to use LettuceClient? In fact, generally we add spring-boot-starter-data-redis dependency through RedisTemp
    Redis 1776 2023-05-28 15:49:06
  • How to get all keys in redis
    How to get all keys in redis
    Keys: Full traverse keys, used to list all keys that meet specific regular string rules. Assuming that redis is in a production environment at this time, using this command will cause hidden dangers. When the amount of redis data is relatively large: keys will be returned at once All keys that meet the conditions will cause redis to freeze. SCAN is a cursor-based iterator that needs to continue the previous iteration process based on the last cursor. SCAN starts a new iteration with 0 as the cursor until the command returns cursor 0 to complete a traversal. This command does not guarantee that each execution will return a given number of elements, or even 0 elements. However, as long as the cursor is not 0, the program will not consider the SCAN command to have ended, but the number of elements returned
    Redis 3737 2023-05-28 15:40:21
  • How to use Redis slow query log
    How to use Redis slow query log
    Slow Query Log What is SLOWLOG? Slowlog is a logging system used by Redis to record command requests whose query execution time exceeds a given time. Query execution time refers to the time spent executing a query command, excluding IO operations such as client response (talking) and sending replies. In addition, slowlog is stored in memory, and the read and write speed is very fast, so you can use it with confidence and don't have to worry about damaging the speed of Redis by turning on slowlog. Setting up and viewing the SLOWLOG server configuration has two options related to slow query logs: slowlog-log-slower-than: The option specifies how many microseconds the execution time exceeds (1
    Redis 1367 2023-05-28 15:37:12
  • How to install redis in docker mode on centos
    How to install redis in docker mode on centos
    1.安装dockersudoyumremovedockerdocker-clientdocker-client-latestdocker-commondocker-latestdocker-latest-logrotatedocker-logrotatedocker-enginesudoyuminstall-yyum-utilssudoyuminstall-yyum-utilssudoyum-config-manager--add-repohttps://download.docker.com/
    Redis 997 2023-05-28 15:34:43
  • How to use python to crawl CSDN popular comment URLs and store them in redis
    How to use python to crawl CSDN popular comment URLs and store them in redis
    1. Configure webdriver to download the Google Chrome driver, and configure importtimeimportrandomfromPILimportImagefromseleniumimportwebdriverfromselenium.webdriver.common.byimportByfromselenium.webdriver.support.uiimportWebDriverWaitfromselenium.webdriver.supportimportexpected_conditio
    Redis 1095 2023-05-28 15:17:23
  • What are the redis expiration strategies?
    What are the redis expiration strategies?
    All data structures in Redis can set expiration time, and they will be automatically deleted when the time is up. You can imagine that there is a god of death inside Redis, always watching all the keys with expiration time set, and harvesting them as soon as their lifespan is reached. You can also think about it from the perspective of Death, whether too many keys expire at the same time, so that you are too busy. At the same time, because Redis is single-threaded, the harvesting time will also occupy the processing time of the thread. If the harvesting is too busy, it will cause lags in online read and write instructions. Expired key collection redis will put each key with an expiration time set into an independent dictionary. This dictionary will be traversed regularly to delete expired keys. In addition to scheduled traversal
    Redis 1321 2023-05-28 15:17:16
  • How to implement Redis connection and authentication in php
    How to implement Redis connection and authentication in php
    Redis connection and authentication //Connection parameters: ip, port, connection timeout, return true if the connection is successful, otherwise return false$ret=$redis->connect('127.0.0.1',6379,30);//Password authentication: Returns true successfully, otherwise returns false$ret=$redis->auth('123456');
    Redis 1071 2023-05-28 15:07:11
  • How to implement code scanning login in redis
    How to implement code scanning login in redis
    Requirements introduction First, let’s introduce what scanning QR code login is. Now, most students have QQ, Taobao, Tmall and other software installed on their mobile phones. The companies that develop these apps have their corresponding websites. In order to make login more convenient and secure for users when using their website. These companies provide services that allow you to log in using your mobile phone and scanning. The effect when logging in to the web page is as follows: Many friends may find it strange that only a QR code is displayed on the web page. How does it know which mobile phone scanned the QR code and logged in? Moreover, after the login is completed, the user information can be directly displayed to the user, which is really amazing. Principle explanation web page + server The next step is the detailed implementation of this service. head
    Redis 1694 2023-05-28 14:58:16
  • How to solve the Redis coupon flash sale problem
    How to solve the Redis coupon flash sale problem
    1 When placing an order to implement the coupon flash sale function, two points need to be judged: 1. Whether the flash sale has started or ended 2. Whether the inventory is sufficient. Therefore, our business logic is as follows 1. Obtain coupon information through the coupon ID 2. Determine whether the flash sale has started. If no error message is returned 3. Determine whether the flash sale is over. If it has ended, return an error message 4. If it is within the flash sale time, determine whether the inventory is sufficient 5. If sufficient, deduct the inventory 6. Create order information and save it to the coupon order In the table 6.1 Save the order id 6.2 Save the user id 6.3 Save the coupon id 7. Return the order id code implementation: (Service layer implementation class) packagecom.hmdp.service.impl;import
    Redis 1371 2023-05-28 14:52:17
  • How to implement Redis Set operation in php
    How to implement Redis Set operation in php
    Set operation //Add an element to the set, and ignore elements that already exist in the set. If the collection does not exist, it will be created first. If the key is not a collection type, it will return false. If the element already exists, it will return 0. If the insertion is successful, it will return 1. $ret=$redis->sAdd('myset','hello');//Return all members in the set. $ret=$redis->sMembers('myset');//Judge whether the specified element is a member of the specified set, return true, otherwise return false. $r
    Redis 1512 2023-05-28 14:04:18

Tool Recommendations

jQuery enterprise message form contact code

jQuery enterprise message form contact code is a simple and practical enterprise message form and contact us introduction page code.
form button
2024-02-29

HTML5 MP3 music box playback effects

HTML5 MP3 music box playback special effect is an mp3 music player based on HTML5 css3 to create cute music box emoticons and click the switch button.

HTML5 cool particle animation navigation menu special effects

HTML5 cool particle animation navigation menu special effect is a special effect that changes color when the navigation menu is hovered by the mouse.
Menu navigation
2024-02-29

jQuery visual form drag and drop editing code

jQuery visual form drag and drop editing code is a visual form based on jQuery and bootstrap framework.
form button
2024-02-29

Organic fruit and vegetable supplier web template Bootstrap5

An organic fruit and vegetable supplier web template-Bootstrap5
Bootstrap template
2023-02-03

Bootstrap3 multifunctional data information background management responsive web page template-Novus

Bootstrap3 multifunctional data information background management responsive web page template-Novus
backend template
2023-02-02

Real estate resource service platform web page template Bootstrap5

Real estate resource service platform web page template Bootstrap5
Bootstrap template
2023-02-02

Simple resume information web template Bootstrap4

Simple resume information web template Bootstrap4
Bootstrap template
2023-02-02

Cute summer elements vector material (EPS PNG)

This is a cute summer element vector material, including the sun, sun hat, coconut tree, bikini, airplane, watermelon, ice cream, ice cream, cold drink, swimming ring, flip-flops, pineapple, conch, shell, starfish, crab, Lemons, sunscreen, sunglasses, etc., the materials are provided in EPS and PNG formats, including JPG previews.
PNG material
2024-05-09

Four red 2023 graduation badges vector material (AI EPS PNG)

This is a red 2023 graduation badge vector material, four in total, available in AI, EPS and PNG formats, including JPG preview.
PNG material
2024-02-29

Singing bird and cart filled with flowers design spring banner vector material (AI EPS)

This is a spring banner vector material designed with singing birds and a cart full of flowers. It is available in AI and EPS formats, including JPG preview.
banner picture
2024-02-29

Golden graduation cap vector material (EPS PNG)

This is a golden graduation cap vector material, available in EPS and PNG formats, including JPG preview.
PNG material
2024-02-27

Home Decor Cleaning and Repair Service Company Website Template

Home Decoration Cleaning and Maintenance Service Company Website Template is a website template download suitable for promotional websites that provide home decoration, cleaning, maintenance and other service organizations. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-05-09

Fresh color personal resume guide page template

Fresh color matching personal job application resume guide page template is a personal job search resume work display guide page web template download suitable for fresh color matching style. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-29

Designer Creative Job Resume Web Template

Designer Creative Job Resume Web Template is a downloadable web template for personal job resume display suitable for various designer positions. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28

Modern engineering construction company website template

The modern engineering and construction company website template is a downloadable website template suitable for promotion of the engineering and construction service industry. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28