A novel cache strategy leveraging Redis with filters to speed up queries
Qiankun Su, Xin Gao, Xin Zhang, Zhihua Wang · 2022
Query response time is an imperative performance parameter for applications driven by database systems. This paper proposes a novel cache strategy to speed up queries, especially in search-within-result. Redis is implemented as a cache server for Mongo database. We convert multiple query conditions into a set of filters and concatenate the filters to be capable of being keys in Redis. Thus, there is a cache hit if a subset of the filters is cached, not requiring that a query is exactly the same as previous queries. This leads to an increase in cache hit ratio and accelerates queries. Experimental results on a real dataset show the effectiveness of our proposal, achieving a 71.27% improvement of the average query response time.