Skip to content

Add SQLite based cache store #6255

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Add SQLite based cache store #6255

wants to merge 2 commits into from

Conversation

pditommaso
Copy link
Member

@pditommaso pditommaso commented Jul 6, 2025

This pull request introduces a new SQLite-based caching mechanism for Nextflow, enabling an alternative to the default cache store. Key changes include adding a new SQLiteCacheStore class, modifying the cache factory to support multiple cache providers, and adding test coverage for the new SQLite implementation.

New SQLite-based caching mechanism:

  • SQLiteCacheStore implementation: Added a new class SQLiteCacheStore that provides an SQLite-based implementation of the CacheStore interface. This includes methods for managing cache entries, creating tables, handling database connections, and ensuring concurrency safety. (modules/nextflow/src/main/groovy/nextflow/cache/sqlite/SQLiteCacheStore.groovy)

  • Test coverage for SQLiteCacheStore: Added comprehensive unit tests for SQLiteCacheStore to validate its functionality, including handling cache entries, managing indexes, and ensuring consistency and concurrency. (modules/nextflow/src/test/groovy/nextflow/cache/sqlite/SQLiteCacheStoreTest.groovy)

Cache factory enhancements:

  • Dynamic cache provider selection: Updated the DefaultCacheFactory to dynamically select the cache provider (sqlite or default) based on the NXF_CACHE_PROVIDER environment variable. Added logging to indicate the selected cache provider. (modules/nextflow/src/main/groovy/nextflow/cache/DefaultCacheFactory.groovy)

  • Logging support: Added the @Slf4j annotation to DefaultCacheFactory to enable logging for debugging and operational insights. (modules/nextflow/src/main/groovy/nextflow/cache/DefaultCacheFactory.groovy)

Dependency updates:

  • SQLite JDBC dependency: Added org.xerial:sqlite-jdbc:3.46.1.3 to the project dependencies to support SQLite database operations. (modules/nextflow/build.gradle)

Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Copy link

netlify bot commented Jul 6, 2025

Deploy Preview for nextflow-docs-staging ready!

Name Link
🔨 Latest commit eb6d271
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/6874e0ce00e5a000083791bf
😎 Deploy Preview https://deploy-preview-6255--nextflow-docs-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pditommaso pditommaso marked this pull request as draft July 6, 2025 10:18
@pditommaso pditommaso changed the title Add SQLite based cache store [ci fast] Add SQLite based cache store Jul 6, 2025
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@bentsherman bentsherman linked an issue Jul 14, 2025 that may be closed by this pull request
@bentsherman
Copy link
Member

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.

Embedded cache DB alternative
2 participants