4 ms·
Sorry. TTL is not an eviction policy, as the others pointed out, you need an eviction algorithm to decide which objects to keep in the cache when it is full. Yo
by 1a1a11a 3y ago
Sorry. TTL is not an eviction policy, as the others pointed out, you need an eviction algorithm to decide which objects to keep in the cache when it is full. Your mindset is about a key-value store, not kv cache, which is always full.
I agree that TTL is useful, but it is NOT a replacement for the eviction algorithm. Moreover, when you have a huge multi-tenanted cache, different engineers set TTLs in different ways, some use TTLs to capture data lifetime, some use TTLs to guard around staleness, some use TTLs for legal compliance. Therefore, TTLs do not indicate eviction priority.