57

Redis和mysql数据怎么保持数据一致的?-wx5c7f616d835a9的博客

 5 years ago
source link: https://blog.51cto.com/14227759/2368320
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
需求起因在高并发的业务场景下,数据库大多数情况都是用户并发访问最薄弱的环节。所以,就需要使用redis做一个缓冲操作,让请求先访问到redis,而不是直接访问MySQL等数据库。这个业务场景,主要是解决读数据从Redis缓存,一般都是按照下图的流程来进行业务操作。读取缓存步骤一般没有什么问题,但是一旦涉及到数据更新:数据库和缓存更新,就容易出现缓存(Redis)和数据库(MySQL)间的数据一致性

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK