2 ms·
I was thinking about how this relates to write-through and write-back in hardware caches, there's an interesting inversion. In a CPU, the cache is there betwee
by MaxBarraclough 6y ago
I was thinking about how this relates to write-through and write-back in hardware caches, there's an interesting inversion.
In a CPU, the cache is there between the CPU proper, and the RAM.
In a write-through CPU, the RAM is the single record of truth, and the cache exists only to speed up reads of those addresses which are currently cached.
In a write-back CPU there is no single record of truth, it has to be pieced together from the RAM in combination with the cache.
In this Memcache set-up though, the database is the complete record of truth, and the cache is is only ever updated after the database write operation has completed, despite that the Memcache cache is faster than the database.
It seems unlikely a CPU would ever update the RAM without touching the cache, but the equivalent is a possibility here.