current location:Home > Technical Articles > Database > Redis

  • Why does Redis choose single thread?
    Why does Redis choose single thread?
    1. Redis version iteration: Redis2.6, supports Lua scripts; Redis3.0, supports clusters; Redis4.0, hybrid persistence, multi-threaded asynchronous deletion; Redis5.0, core code reconstruction; Redis6.0, multi-threaded IO; Redis7.0, Function, Multi-part-AOF; 2. Why did Redis always use single thread before Redis4.0? 1. Redis adopts a single-threaded model to facilitate development and maintenance; 2. The single-threaded model can also handle multiple client requests concurrently through IO multiplexing and non-blocking IO; 3. For Redis, the main performance bottleneck is memory and Network, not CPU; 3. Redis6
    Redis 1882 2023-05-30 13:01:33
  • How to build a Redis cluster based on Docker
    How to build a Redis cluster based on Docker
    Environment: Docker+(Redis:5.0.5*3)1. Pull the image dockerpullredis:5.0.52. Create a Redis container. Create three redis containers: redis-node1: 6379redis-node2: 6380redis-node3: 6381dockercreate--nameredis-node1 -v/data/redis-data/node1:/data-p6379:6379redis:5.0.5--cluster-enabledyes--cluster-config-filenodes
    Redis 1419 2023-05-30 12:46:07
  • How to integrate SpringBoot and Redis
    How to integrate SpringBoot and Redis
    Integration of SpringBoot and non-relational database Redis (1) Add the SpringDataRedis dependency starter and introduce this dependency to create a project. The following dependencies will appear in the project pom.xml file: (2) Write the entity class Person: packagecom.hardy.springbootdataredis.domain ;importorg.springframework.data.annotation.Id;importorg.springframework.data.redis.core.RedisHash;importorg.s
    Redis 782 2023-05-30 12:03:40
  • How to deploy redis database in CentOS
    How to deploy redis database in CentOS
    Redis has created a new data storage idea. Using Redis, we don't have to focus on how to put the elephant into the refrigerator when facing a database with monotonous functions. Instead, we can use Redis's flexible and changeable data. Structure and data manipulation, building different refrigerators for different elephants. The specific steps to deploy redis on CentOS are to unzip, enter the redis directory make&&makeinstall, compile and install, check the running status, modify the configuration file /etc/redis/6379.conf, set the password, and then modify the redis.properties mentioned earlier. Use the following command to view the data indicating that redis has started. It worked
    Redis 1179 2023-05-30 11:55:36
  • What are the common ways to use Redis?
    What are the common ways to use Redis?
    1. Common usage methods Several common usage methods of Redis include: 1. Redis single copy; 2. Redis multiple copies (master-slave); 3. Redis Sentinel (sentinel); 4. Redis Cluster; 5. Redis self-research. 2. Advantages and disadvantages of various usage methods 1. Redis single copy Redis single copy adopts a single Redis node deployment architecture. There is no backup node to synchronize data in real time, and does not provide data persistence and backup strategies. It is suitable for applications with low data reliability requirements. Pure caching business scenario. Advantages: simple architecture and easy deployment; high cost performance: no backup node is required when using cache (single instance availability can be guaranteed with supervisor or crontab
    Redis 2472 2023-05-30 11:53:08
  • What is the method for implementing delay queue in Redis?
    What is the method for implementing delay queue in Redis?
    1. Introduction 1.1. What is a delay queue? The biggest difference between a delay queue and an ordinary queue is reflected in its delay attribute. The elements of an ordinary queue are first in, first out, and are processed in the order they are added to the queue, while the delay queue The elements in will be assigned a delay time when they are enqueued, indicating that they hope to be processed after the specified time has passed. In a sense, the structure of the delay queue is not like a queue, but more like an ordered heap structure with time as the weight. 1.2. Application Scenarios In some business scenarios, we often encounter functions that need to be executed after a period of time or at a certain time point. For example, the following scenarios: Create a new order, and if payment is not made within the specified time, the takeout needs to be automatically canceled or the taxi will arrive at the estimated time.
    Redis 2373 2023-05-30 11:29:25
  • How to configure the master-slave mode of Redis cluster
    How to configure the master-slave mode of Redis cluster
    1. Why is a cluster needed? In our actual development, it is not possible to use only one Redis in engineering projects for the following reasons: (1) Structurally, a single Redis server will have a single point of failure, and one server needs to handle all requests. load and pressure; (2) In terms of capacity, the memory capacity of a single Redis server is limited. Even if the memory capacity of a Redis server is 256G, all the memory cannot be used as Redis storage memory. Generally speaking, the maximum usage of a single Redis server is Memory should not exceed 20G. (3) The reading and writing performance of a single Redis server is limited, and the reading and writing capabilities can be improved by using a cluster. 2. Introduction to master-slave mode Currently, Redis has three cluster modes:
    Redis 2897 2023-05-30 10:47:23
  • How to solve the problem that php5.6 cannot extend redis.so
    How to solve the problem that php5.6 cannot extend redis.so
    First, let's understand what Redis is. Redis is a high-performance key-value storage database that can be used to store, read, and operate various types of data, such as strings, hash tables, lists, sets, and ordered sets, etc. It mainly uses memory as the storage medium, making Redis very fast and efficient. PHP interacts with Redis by extending redis.so or phpredis extension. These extensions provide various API functions so that developers can easily access Redis in PHP code. However, in some versions of PHP, especially php5.6, there are some problems that cause these extensions to not work properly. If you are using php5.6 version and
    Redis 1332 2023-05-30 10:21:44
  • What are the basic knowledge points of Redis?
    What are the basic knowledge points of Redis?
    1. What is Redis? Let’s first take a look at the introduction given by the Redis official website: Redisisan opensource (BSDlicensed), in-memorydatastructurestore, usedasadatabase, cacheandmessagebroker. It supports datastructures such as strings, hashes, lists, sets, sortedsetswithrangequeries, bitmaps, hyperloglogs, geospatialindexeswit
    Redis 858 2023-05-30 09:38:16
  • centos7 yum installation redis and what are the common commands
    centos7 yum installation redis and what are the common commands
    What is redis? Redis is a memory-based data structure storage, durable log-type, Key-Value database. When a site using a relational database reaches a certain amount of concurrency, there will often be a bottleneck in disk IO. At this time, working with redis has certain advantages because it has the following characteristics: running based on memory, high concurrency reading and writing; support Distributed, theoretically infinitely expandable; rich data types; persistent, can be written to disk regularly; application scenarios cache "hot" data (high-frequency reading, low-frequency writing) counters, current limiter message queue system (publish and subscribe, Ranking list) Distributed lock, shared session, queue data type: The data types provided by Redis are mainly divided into 5 types.
    Redis 1072 2023-05-30 09:36:07
  • How to install redis in CentOS7 and configure it to be accessible from the external network
    How to install redis in CentOS7 and configure it to be accessible from the external network
    1. Install gcc editor. Installing redis needs to rely on the gcc environment. Execute the following command to install: yuminstall-ygcc. If the machine does not have a network, you can refer to this article: CentOS offline installation of gcc environment (with installation package + pictures and texts) 2. Download redis installation Package redis official website: https://redis.io/download Download and upload to CentOS, for example, upload to /usr/local/3. Unzip and compile the installation redis command. The command is as follows: 1. Enter the installation package directory cd/usr/local/ 2. Unzip the installation package tar-zxvfredis-6.2.1.tar.gz3 and enter
    Redis 1527 2023-05-30 09:29:08
  • How to implement pipelines by integrating Redis in SpringBoot
    How to implement pipelines by integrating Redis in SpringBoot
    1. The Redis pipeline executes a Redis command. The Redis client and Redis server need to perform the following steps: the client sends the command to the server; the server accepts the command request, executes the command, and generates the corresponding result; the server returns the result to the client. client; the client accepts the execution results of the command and displays them to the user. Most of the time spent by Redis commands is spent on sending command requests and receiving command results. Packing any number of Redis command requests together, and then sending them all to the server at once, and the server will send all commands After all requests are processed, all their execution results are returned to the client at once. Note: Red
    Redis 1416 2023-05-30 09:19:56
  • Example analysis of server-side request forgery SSRF in Redis
    Example analysis of server-side request forgery SSRF in Redis
    SSRF, that is, server-side request forgery. When the server needs to request resources, the requested resources, protocols, paths, etc. can be controlled by the user. This can cause SSRF attacks. This article focuses on the SSRF attack on the Redis service through the gopher protocol, and then getshell. Gopher protocol format First, let’s understand what the gopher protocol is and what the format looks like: gopher://://_ followed by TCP data stream. When we test the attack on redis, we can use the curl that comes with Linux for testing. If you use Centos, in order to ensure the success of the experiment, it is best to turn off Centos's selinux. Turn off selinux:setenfor
    Redis 1302 2023-05-30 09:18:28
  • How to implement Redis persistence
    How to implement Redis persistence
    Redis is an advanced key-value database. It is similar to memcached, but data can be persisted and supports a wide range of data types. There are strings, linked lists, sets and sorted sets. It supports calculating the union, intersection and complement (difference) of sets on the server side, and also supports a variety of sorting functions. Redis supports two persistence mechanisms: RDB and AOF. Persistence can avoid data loss caused by abnormal process exit or downtime. The previous persistence file can be used to achieve data recovery during the next restart. RDB persistence RDB persistence is persisted by creating snapshots (compressed binary files) to save the full amount of data at a certain point in time. RDB persistent
    Redis 723 2023-05-30 09:14:45
  • How to implement Redis Hash operation in php
    How to implement Redis Hash operation in php
    Hash operation //Assign values ​​to fields in the hash table. Returns 1 on success and 0 on failure. If the hash table does not exist, the table will be created first and then the value will be assigned. If the field already exists, the old value will be overwritten. $ret=$redis->hSet('user','realname','jetwu');//Get the value of the specified field in the hash table. If the hash table does not exist, return false. $ret=$redis->hGet('user','rea
    Redis 1297 2023-05-30 08:58:05

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