A method for semi-synchronous caching data

By optimizing the Redis master-slave replication process, adopting an asynchronous ack mechanism and a semi-synchronous downgrade strategy, the latency and consistency problems in cached data synchronization are solved, data reliability and throughput performance are improved, and distributed cache systems such as e-commerce systems and social applications are suitable.

CN117874129BActive Publication Date: 2025-07-29CHINA TELECOM CLOUD TECH CO LTD
2 Cites 0 Cited by

Patent Information

Application Number
CN202311720255.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-14
Publication Date
2025-07-29
Estimated Expiration
2043-12-14

AI Technical Summary

Technical Problem

The existing cached data synchronization methods have data latency, data consistency problems and data loss risks during master-slave replication, especially in high real-time and low latency application scenarios.

Method used

The asynchronous ack mechanism is used to optimize the Redis master-slave replication process. Through the incremental command semi-synchronous replication mechanism, combined with the customized semi-synchronous downgrade strategy, it will automatically downgrade to asynchronous replication when the network fluctuates, and restore it to semi-synchronous replication when the network is restored. The distributed cache proxy layer service and AOF file management synchronization process of write operation commands is used.

Benefits of technology

Improve data reliability under single point of failure, reduce data latency, ensure data consistency, and maintain throughput performance when network fluctuations, providing real-time monitoring and status judgment friendliness.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The present invention relates to a method for semi-synchronous caching data, belonging to the technical field of middleware, and includes the following steps: Write and run a distributed cache proxy layer service using a preset programming language, receive read and write command requests from application clients, parse the Key consistent hash value, and send it to the backend Redis shard nodes. The master instance parses the message packet, marks the write operation and records it in the AOF file. After the disk write is completed, the master instance sends an AOF file transfer command to the slave instance node, and the slave instance executes the receipt. After the master instance receives the receipt response, it updates the confirmation offset of the slave node and responds to the client. When the network latency is high, mark the data of the master and slave nodes as "out of sync" and automatically degrade to asynchronous replication. The present invention optimizes the implementation of master-slave semi-synchronization in Redis by self-developing the Redis kernel and using the asynchronous ack mechanism, improves the data reliability of single-point failures, and solves the problems of data latency and data consistency caused by the native Redis asynchronous replication mechanism.
Need to check novelty before this filing date? Find Prior Art