3 ms·
The cache-perma seems pretty clever to me. > For example, when new comments are added or votes are changed, we don’t simply invalidate the cache and move on—th
by jrowley 10y ago
The cache-perma seems pretty clever to me.
> For example, when new comments are added or votes are changed, we don’t simply invalidate the cache and move on—this happens too frequently and would make the caching near useless. Instead, we update the backend store (in Cassandra) as well as the cache. Fallback can always happen to the backend store if need be, but in practice this rarely happens. In fact, permacache is one of our best hit rates—over 99%.
They basically have their application state duplicated in both places. Interesting architectural choice.
- hehheh 10y agoThis sounds an awful lot like an old(ish?) technique termed "write-through caching". Building data structures that can take advantage of write-through caching at reddit-comment-scale does sound like it'd be an interesting problem to optimize.
- jedberg 10y agoThat's basically what it is. The data is abstracted away so that when you do a write it just goes to both places as needed.