Abstract:
To address the problems of distributed clustering technology in maintaining strong data consistency with high cost and maintenance difficulties, we propose a data consistency strategy (DataConsistency-DoubleRedisKafka, DC-R2K) based on double cache and message queue mode with low resource allocation, aiming to achieve the final consistency of data without user perception with the lowest latency. This paper analyzed the data storage methods of cached databases and relational databases, and constructed a Redis-based storage model to initialize hot data to a double-cached database with read and write separation. The paper used message queue to receive buffer for read requests in high concurrent requests and divert read and write requests. The paper completed asynchronous update of data through message queue to reduce the time consumption of data consistency as much as possible. The experimental results show that DC-R2K improves the application throughput by 13.68%~26.96% and reduces the response time by 47.22%~86.75% compared with the traditional single cache, with lower resource consumption compared with the use of clustered servers, and the results have practical application value.