Skip to content

Cache Versioning and Migration System #311

Description

@olodeokutaope-rgb

Implement a comprehensive cache versioning system that allows developers to version their cached function outputs and automatically handle cache migrations when function logic or return schemas change.

Technical Details:

  • Add a cache_version parameter to the @cachier decorator
  • Store version metadata alongside cached values in all backend cores
  • Implement automatic cache invalidation when version changes
  • Create a migration framework allowing custom migration functions between versions
  • Support semantic versioning (e.g., version="1.2.3")
  • Add migrate_cache(old_version, new_version, migration_func) API
  • Include backward compatibility mode to read old versions temporarily
  • Implement version compatibility checking and warnings

Use Cases:

  • Function logic changes requiring cache rebuild
  • Data schema evolution over time
  • Team collaboration with different code versions
  • Production deployments with zero-downtime migrations

Complexity Factors:

  • Requires changes to all backend cores (Pickle, MongoDB, Redis, SQL, Memory)
  • Schema migration logic for different backends
  • Thread-safe migration process
  • Rollback mechanisms for failed migrations

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions