Skip to content

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

  1. 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
  2. Implement cache invalidation logic for each identified scenario
  3. Ensure that cache invalidation occurs in near real-time to minimize discrepancies
  4. Implement a fallback mechanism to periodically refresh the cache, even if no invalidation events are triggered

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

Next Steps

  1. Document all scenarios that should trigger cache invalidation
  2. Design the cache invalidation architecture
  3. Implement the invalidation logic
  4. Create unit and integration tests
  5. Update relevant documentation
  6. Perform load testing to ensure scalability
Edited by Doug Stull