Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache transcript protein links in Redis #94

Merged
merged 2 commits into from
Oct 20, 2015
Merged

Conversation

martijnvermaat
Copy link
Contributor

No description provided.

@jfjlaros
Copy link
Member

Does this mean that the cache is cleared on a restart?

@martijnvermaat
Copy link
Contributor Author

No. Although Redis is a memory store, its contents are saved to disk (of
which we make backups like for postgresql). The stat counters are also
stored here.
On Oct 16, 2015 21:27, "Jeroen F.J. Laros" notifications@github.com wrote:

Does this mean that the cache is cleared on a restart?


Reply to this email directly or view it on GitHub
mutalyzer/mutalyzer#94 (comment).

@martijnvermaat martijnvermaat force-pushed the redis-links branch 2 times, most recently from 02e4a3e to 7deeb7e Compare October 17, 2015 17:47
Caching of transcript protein links received from the NCBI Entrez
service is a typical use case for Redis. This implements this cache
in Redis and removes all use of our original database table.

An Alembic migration copies all existing links from the database to
Redis. The original `TranscriptProteinLink` database table is not
dropped. This will be done in a future migration to ensure running
processes don't error and to provide a rollback scenario.

We also remove the expiration of links (originally defaulting to 30
days), since we don't expect them to ever change. Negative links
(caching a 'not found' result from Entrez) *are* still expiring,
but with a longer default of 30 days (was 5 days).

The configuration setting for the latter was renamed, yielding the
following changes in the default configuration settings.

Removed default settings:

    # Expiration time for transcript<->protein links from the NCBI (in seconds).
    PROTEIN_LINK_EXPIRATION = 60 * 60 * 24 * 30

    # Expiration time for negative transcript<->protein links from the NCBI (in
    # seconds).
    NEGATIVE_PROTEIN_LINK_EXPIRATION = 60 * 60 * 24 * 5

Added default setting:

    # Cache expiration time for negative transcript<->protein links from the NCBI
    # (in seconds).
    NEGATIVE_LINK_CACHE_EXPIRATION = 60 * 60 * 24 * 30
martijnvermaat added a commit that referenced this pull request Oct 20, 2015
Cache transcript protein links in Redis
@martijnvermaat martijnvermaat merged commit b80ac8e into master Oct 20, 2015
@martijnvermaat martijnvermaat deleted the redis-links branch October 20, 2015 07:35
martijnvermaat added a commit that referenced this pull request Nov 9, 2015
This data is now in Redis, by #94.

Fixes #95
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants