Redis Node Connection via Mapping Table
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing distributed computing systems for Redis master-slave management are complex and costly, with high system management costs and performance inefficiencies due to the need for multiple keepalived instances and the use of haproxy for connection forwarding, which can lead to increased burden and waiting times.
Innovation Solution
A node connection method utilizing a mapping table to directly connect Redis clients to real nodes, allowing for virtual node management and automatic updating of mapping relationships upon master-slave changes, reducing the need for complex systems like keepalived and haproxy, and utilizing sentinel and zookeeper for monitoring and notification.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If haproxy is used for connection forwarding, then connection management is achieved, but system complexity and management cost increase
Solution Approach 1:
The patent extracts and removes the haproxy component from the system, allowing Redis clients to connect directly to Redis nodes without requiring a separate connection forwarding layer. This eliminates the complexity and management overhead of haproxy while maintaining connection management functionality through direct node connections.
Solution Approach 2:
The patent introduces a node information data structure as an intermediary mechanism that stores and manages Redis node connection information. This replaces the need for haproxy by providing a simplified way to track and access node details, reducing system complexity while maintaining connection management capabilities.
2Reliability
If haproxy is used for connection forwarding, then connection management is achieved, but connection performance and speed decrease
Solution Approach 1:
By removing haproxy from the connection path, the patent eliminates the additional processing and waiting time it introduces. Redis clients can now connect directly to nodes, significantly improving connection speed and performance while maintaining reliable connection management through the node information data structure.
3Reliability
If multiple keepalived instances are used for managing multiple Redis master-slave, then high availability is achieved, but system cost increases
Solution Approach 1:
The patent makes the node information data structure multi-functional, enabling it to handle monitoring, connection management, and high availability tasks that previously required separate keepalived instances. This universal approach reduces system cost by eliminating the need for multiple specialized components while maintaining high availability across multiple Redis master-slave configurations.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
The present disclosure provides a node connection method and a distributed computing system. The distributed computing system comprises a plurality of clients and a plurality of servers. A server comprises a mapping table. The node connection method comprises: recording node information and a mapping relationship between nodes in the mapping table; visiting, by a client, a service side of the distributed computing system based on the node information; acquiring a target node corresponding to the node information in the mapping table; and connecting, by the client, to the target node. The present disclosure may simplify a system structure of the distributed computing system, reduce the system management cost, and improve the working efficiency of the client in the system and the master-slave changing speed in each server.