-
Type: Epic
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Done
-
Driver Query Cache
Summary
To allow Ruby applications using Mongoid to utilize modern retryable reads when they also want to utilize the query cache, the query cache implementation must be moved to the driver from Mongoid where it presently exists.
The work to be done is as follows:
1. Implement caching cursor in driver, using the current caching cursor in Mongoid as reference.
2. Implement query cache (on top of the caching cursor) in driver, using the respective code in Mongoid as reference.
3. Remove all cursor code from Mongoid.
4. Modify Mongoid to use the driver's query cache while providing an equivalent or similar API to what is available today.
A side benefit of this work is the potential to use query cache with the driver only, to cache individual (MQL) queries.
Motivation
Currently the query cache, as implemented by Mongoid, duplicates a portion of driver's cursor code plus adds the query caching on top. This has two issues:
1. The code that was copied is by now outdated. It uses legacy read retries (even when modern read retries are supposed to be used), performs server selection in an outdated way, etc.
2. Changes to the driver can break the query cache, due to the query cache's reliance on driver internals.
Since the query cache operates on collection/operation/cursor level, it can be implemented in the driver, with Mongoid only exposing the implementation using a (more) convenient API.
Cast of Characters
- Product Owner: Rachelle Palmer
- Project Lead: Emily Guirleo
- Program Manager: Alexander Golin
Documentation
Scope Document
[Technical Design Document|]