current location:Home > Technical Articles > Database > Redis
- Direction:
- All web3.0 Backend Development Web Front-end Database Operation and Maintenance Development Tools PHP Framework Common Problem Other Tech CMS Tutorial Java System Tutorial Computer Tutorials Hardware Tutorial Mobile Tutorial Software Tutorial Mobile Game Tutorial
- Classify:
-
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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?
- 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
- 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
- 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
- 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
- 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