The most important thing is to ensure the unity of cache and real data. If the read cache misses, read the real data, read and write to the cache Write/delete/modify the real data first, and then operate the cache after success.
The operations of cache and real data must be consistent. Read-write locks can be used to control the problem of old data being acquired by the cache during the period after the real data is operated on.
The most important thing is to ensure the unity of cache and real data.
If the read cache misses, read the real data, read and write to the cache
Write/delete/modify the real data first, and then operate the cache after success.
The operations of cache and real data must be consistent. Read-write locks can be used to control the problem of old data being acquired by the cache during the period after the real data is operated on.