首页|期刊导航|计算机应用与软件|基于双缓存和消息队列模式的数据一致性策略研究

基于双缓存和消息队列模式的数据一致性策略研究OA

DATA CONSISTENCY STRATEGY BASED ON DOUBLE CACHE AND MESSAGE QUEUE PATTERN

中文摘要英文摘要

针对目前主流的分布式集群技术在维护数据强一致性方面存在成本较高、维护困难等问题,提出一种在低资源配置下,基于双缓存和消息队列模式的数据一致性策略(Data Consistency-Double Redis Kafka,DC-R2K),旨在以低时延实现用户无感知的数据最终一致.分析两类数据库的存储结构,构建基于 Redis 的存储模型,将热点数据写入读写分离的双缓存数据库;使用消息队列对高并发请求中的读请求接收缓冲,并分流读写请求;通过消息队列完成数据的异步更新,尽可能降低数据一致的时间消耗.实验结果表明,在保证数据一致的前提下,DC-R2K 相较于使用传统单缓存的应用吞吐量提升 13.68%~26.96%,响应时间降低 47.22%~86.75%,与使用集群服务器相比资源消耗更低,具有实际应用价值.

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(Data Consistency-Double Redis Kafka,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 by13.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.

高佳宁;刘美;杨富钧;孙芊;廖雪花

四川师范大学计算机科学学院 四川 成都 610101四川师范大学计算机科学学院 四川 成都 610101四川师范大学计算机科学学院 四川 成都 610101四川师范大学计算机科学学院 四川 成都 610101四川师范大学计算机科学学院 四川 成都 610101

信息技术与安全科学

双缓存消息队列数据一致性高并发

Double cacheMessage queueData consistencyHigh concurrency

《计算机应用与软件》 2026 (4)

10-18,27,10

国家社会科学基金一般项目(20BMZ092).

10.3969/j.issn.1000-386x.2026.04.002

评论