Question
Enable Query Cache vs. Rely on InnoDB Buffer Pool for Read‑Heavy Workloads in MariaDB 10.3–10.5
Zo River
0 reputation · 17 May 2022, 09:55 UTC
51.8K views0
Goal
Determine the optimal caching strategy for a read‑heavy application running on MariaDB 10.3–10.5, where occasional writes occur and stale reads may be tolerable.
Constraints & Uncertainty
- The Query Cache is enabled only if explicitly configured (query_cache_type=1, query_cache_size>0).
- It stores complete result sets and ignores transaction isolation, so reads after a write can return stale data.
- Every write invalidates affected cache entries, adding overhead that may hurt throughput under mixed workloads.
- Mariadb 10.6+ removed the feature, so the decision is only relevant for 10.3–10.5.
Unresolved Decision
Should the application enable the Query Cache to reduce latency on repetitive SELECTs, or rely solely on the InnoDB buffer pool, which keeps data pages in memory but does not cache result sets?
Specific Questions
- In a workload with 90% reads and 10% writes, how does the average latency of repeated identical SELECTs compare when the Query Cache is enabled versus when it is disabled?
- What is the measurable impact on data freshness when the Query Cache is enabled, given that isolation levels are ignored?
- How significant is the cache invalidation overhead on overall throughput for mixed read/write patterns in MariaDB 10.3–10.5?