策略1 - 先更新数据库,再更新缓存
分析一(线程安全角度)
同时有请求A和请求B进行更新操作,那么会出现
- 线程A更新了数据库
- 线程B更新了数据库
- 线程B更新了缓存
- 线程A更新了缓存
一般来说,请求A更新缓存应该比请求B更新缓存早才对,但理论上,也可能因为网络等原因(虽然概率相对较低),B却比A更早更新了缓存。这就导致了脏数据。
...Data migration is the process of selecting, preparing, extracting, and transforming data and permanently transferring it from one computer storage system to another. Additionally, the validation of migrated data for completeness and the decommissioning of legacy data storage are considered part of the entire data migration process.
...