Add proper caching invalidation for trial eligibility
Background
As part of our effort to improve the trial experience for GitLab customers, we've implemented a caching mechanism for trial eligibility information. To ensure that this cached data remains accurate and up-to-date, we need to implement a robust caching invalidation strategy.
Objective
Implement a proper caching invalidation mechanism for trial eligibility data to maintain data consistency between GitLab and CDOT (Customer Dot).
Requirements
- Identify all scenarios that should trigger cache invalidation, such as:
- Changes in subscription status
- Completion or cancellation of a trial
- Manual updates to trial history in CDOT
- Implement cache invalidation logic for each identified scenario
- Ensure that cache invalidation occurs in near real-time to minimize discrepancies
- Implement a fallback mechanism to periodically refresh the cache, even if no invalidation events are triggered
- If we use the current GitLab default app cache expiration settings, this should be fulfilled
Technical Considerations
- Use a distributed cache invalidation approach to ensure consistency across all GitLab instances
- Implement logging and monitoring for cache invalidation events to track performance and troubleshoot issues
- Ensure that the invalidation mechanism is scalable and can handle high-volume scenarios
Acceptance Criteria
-
Cache invalidation is triggered for all identified scenarios -
Invalidation events are processed within an acceptable time frame (e.g., < 1 minute) -
Fallback mechanism is in place to periodically refresh the cache -
Logging and monitoring are implemented for cache invalidation events -
Performance tests demonstrate that the invalidation mechanism can handle expected load -
Documentation is updated to reflect the new cache invalidation strategy
Related Issues/Epics
- Parent Epic: Use CustomersDot as the trial eligibility Singl... (&16169 - closed)
- Create endpoint to determine namespace trial eligibility
- Implement caching mechanism for trial eligibility data
Next Steps
- Document all scenarios that should trigger cache invalidation
- Design the cache invalidation architecture
- Implement the invalidation logic
- Create unit and integration tests
- Update relevant documentation
- Perform load testing to ensure scalability
Edited by Doug Stull