TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

What is hard about Cache Invalidation

1 pointsby uvdn7almost 3 years ago

1 comment

PaulHoulealmost 3 years ago
It depends on your case.<p>In something like a triple store you assign compact unique identities (maybe integer) to nodes, so you have to look up<p><pre><code> &lt;https:&#x2F;&#x2F;dbpedia.org&#x2F;resource&#x2F;Dracula&gt; </code></pre> and replace it with 77182. If you are looking these up in the database each time it is terribly slow and you get an orders-of-magnitude speedup in a bulk loading job if you keep a cache in a hashtable.<p>The strategy of &quot;empty the hashtable when it gets full&quot; gives you most of the gains of caching and is not that much worse than an optimal solution. For an online system though it would be unacceptable because the performance of the system would be disasterous because it would slow down the server, make your connection count go through the roof, make it run out of RAM and start to swap, etc.<p>CPU designers have a devilishly hard problem with cache coherency because they have to support every workload and today we know information leakage in the TLB and other structures is a big problem on top of simply &quot;correctness&quot; and &quot;performance&quot;.