Define Cache Hit Ratio and explain why a low ratio is a performance concern.

Python interview question for Advanced practice.

Answer

The Cache Hit Ratio is the percentage of total requests served by the cache rather than the primary data source. A low ratio indicates that the cache is frequently missing, forcing slow database lookups and increasing latency. This often signals a need for a larger cache size, a better eviction policy, or a longer TTL.

Explanation

A cache hit ratio of 90% or higher is typically targeted for high-performance systems.

Related Questions