rails/solid_cache
55.4
Adequate · 20 September 2026
1.2k
lines of production code
Ruby
primary language
1
measurement over time
What this system is
Solid Cache is a Ruby gem that provides a persistent, database-backed caching store for Rails applications, serving as a drop-in replacement for in-memory caches. It supports horizontal scaling through database sharding, ensures data security with optional value encryption, and manages storage efficiency via configurable size-based expiration. The system includes tooling for automated installation, schema generation, and comprehensive testing across multiple Rails versions and database engines.
How it got here
2022 — Solid Cache migration and project scaffolding
18 changes.
This period focused on renaming the gem to Solid Cache and migrating the codebase from the legacy ActiveSupport::DatabaseCache implementation. The work involved removing all legacy engine boilerplate and tests while establishing a new project structure with comprehensive tooling, multi-version Rails support, and robust test infrastructure for the new caching strategy.
2023 — SolidCache engine development
12 changes.
This period focused on the creation and refinement of the SolidCache engine, a database-backed caching solution for Rails that supports sharding, encryption, and modular configuration. The work involved implementing core caching logic, establishing a standard Active Support adapter, and providing an installation generator for seamless integration. Comprehensive test coverage and Appraisal configurations were added to ensure stability across multiple Rails versions.
2024 — Solid Cache feature expansion
4 changes.
This period focused on enhancing Solid Cache with value encryption and size-based expiration capabilities, supported by comprehensive test coverage for the new estimation logic. The release also improved installation flexibility by adding SQL schema support and standardized configuration by renaming the default template to cache.yml.
Features
Add SQL schema generation and release tooling to the bin directory
This change introduces several new executable scripts to the project's bin directory to support development, testing, and release workflows. It adds bin/generate\_structure\_sqls and bin/generate\_structure\_sql to automate the creation of SQL schema files (for SQLite, MySQL, and PostgreSQL) by leveraging Docker containers for consistent database dumps, enabling installation with SQL schema formats. A new bin/release script is added to streamline the version bumping, tagging, and publishing process to RubyGems. Additionally, standard Bundler binstubs for irb, rake, rdbg, and rubocop are included, and the bin/setup script is updated to initialize the development environment using Docker and set up databases for all supported SQL dialects.
bin · high confidence
Add solid\_cache:install generator for automatic setup
Introduces a new \bin/rails generate solid\_cache:install\ command that automates the integration of Solid Cache as the Rails cache store. Running this generator copies the necessary configuration file (\config/cache.yml\), installs the appropriate database schema (either a Ruby schema file or adapter-specific SQL structure for PostgreSQL, MySQL, and SQLite), and automatically updates the production environment configuration to use the \:solid\_cache\_store\.
_lib/generators/solid\cache/install · high confidence
Initial project scaffolding and configuration
This change introduces the foundational structure for the Solid Cache gem, including a comprehensive RuboCop configuration for code style enforcement, Appraisals for testing against multiple Rails versions (7.2, 8.0, 8.1, and main), and a Docker Compose setup for local database services (PostgreSQL and MySQL). It also adds an upgrading guide for version 0.4.x, updates the license to 37signals, and significantly expands the README with detailed installation, configuration, and sharding instructions.
(repo-wide) · high confidence
Introduce SolidCache as a database-backed caching store
This change introduces the \SolidCache\ engine, providing a new database-backed caching implementation for Rails applications. The core components include \SolidCache::Record\, which handles database connections, sharding, and instrumentation control, and \SolidCache::Entry\, which manages cache operations such as writing, reading, and deleting entries. The implementation supports batched multi-key operations, key hashing for efficient indexing, and configurable encryption and row size estimation, offering a persistent alternative to in-memory caches.
_app/models/solid\cache · high confidence
Removals
Removal of DatabaseCache module
The \ActiveSupport::DatabaseCache\ module and its associated engine have been removed from the library. This change eliminates the previous database-backed caching implementation, aligning with the project's shift away from this specific caching strategy.
_lib/active\support · high confidence
Behavioural changes
Active Support now includes a Solid Cache store adapter
The previous \ActiveSupport::DatabaseCache\ module has been removed and replaced by \ActiveSupport::Cache::SolidCacheStore\, which exposes \SolidCache::Store\ as a standard cache store implementation. This change allows applications to use Solid Cache as a drop-in replacement for existing cache stores within the Active Support caching interface.
_lib/active\support/cache · high confidence
Default cache configuration file renamed to cache.yml
The Solid Cache generator now creates a \config/cache.yml\ file by default instead of \solid\_cache.yml\. This new template includes environment-specific settings for development, test, and production, with the production environment explicitly referencing the database via the \DATABASE\ environment variable.
_lib/generators/solid\cache/install/templates/config · high confidence
Migration from ActiveSupport::DatabaseCache to SolidCache with size-based expiry
The application has replaced the legacy ActiveSupport::DatabaseCache implementation with SolidCache. This change removes the previous job infrastructure and associated layout views, introducing a new SolidCache::ExpiryJob that handles cache expiration. Users will now benefit from cache eviction based on configurable limits, including maximum age, entry count, and total size, ensuring more efficient memory and storage management.
app/jobs · high confidence
Migration to SolidCache installation task
The application now uses SolidCache for caching, replacing the previous Active Support database cache implementation. A new rake task, \solid\_cache:install\, has been added to \lib/tasks/solid\_cache\_tasks.rake\ to facilitate the installation process by invoking the SolidCache generator. The legacy \active\_support/database\_cache\_tasks.rake\ file has been removed.
lib/tasks · high confidence
Removal of ActiveSupport::DatabaseCache engine scaffolding
The application no longer includes the generated scaffolding for the ActiveSupport::DatabaseCache engine. Specifically, the asset manifest, stylesheets, helper module, and mailer class associated with this engine have been removed, aligning with the migration away from this caching implementation.
app/assets, app/helpers, app/mailers · high confidence
Removal of Rails Engine wrapper for DatabaseCache
The \lib/active\_support/database\_cache/engine.rb\ file, which previously defined \ActiveSupport::DatabaseCache::Engine\ to isolate the namespace as a Rails Engine, has been deleted. This change removes the engine structure from this specific location, aligning with the broader shift to load the component via Zeitwerk and rename the functionality to SolidCache.
_lib/active\_support/database\cache · high confidence
Removal of abstract ApplicationRecord base class
The abstract \ApplicationRecord\ base class within the \ActiveSupport::DatabaseCache\ module has been removed. This eliminates the inheritance hierarchy for database cache models in this area, meaning any classes previously inheriting from this base must now inherit directly from \ActiveRecord::Base\ or another appropriate parent.
_app/models/active\support · high confidence
Removal of empty boilerplate placeholder
The empty placeholder file (.keep) in the app/models/concerns directory has been removed, cleaning up unused engine boilerplate.
app/models/concerns · medium confidence
Removal of legacy database cache engine boilerplate
The application has removed the legacy \ActiveSupport::DatabaseCache\ engine structure, including the \ApplicationController\ base class, the associated route definitions, and the concerns placeholder. This cleanup eliminates unused engine boilerplate, aligning the codebase with the migration to SolidCache and reducing unnecessary file overhead.
app/controllers, config · high confidence
Solid Cache 1.0.10: Sharding, Encryption, and Configuration Refactor
Solid Cache has been updated to version 1.0.10, introducing a major architectural shift to support sharded deployments and encrypted cache values. The library now uses Maglev hashing to distribute cache keys across multiple database shards, allowing for horizontal scaling beyond a single database connection. Configuration has been centralized into a new \SolidCache::Configuration\ class, reading from \config/cache.yml\ or \config/solid\_cache.yml\, and supports explicit encryption settings that leverage Active Record Encryption (with a specific check preventing encryption on PostgreSQL in Rails 7 due to binary column limitations). The engine now requires \active\_record\ and manages database connections via a new \Connections\ module that handles single, sharded, or unmanaged connection strategies based on the configuration.
_lib/solid\cache · high confidence
Solid Cache now supports value encryption and size-based expiration
Solid Cache entries can now be encrypted via configuration, and the cache automatically expires entries based on size limits using a moving average estimate to track total cache size.
_app/models/solid\cache/entry · high confidence
SolidCache library initialization and configuration setup
The SolidCache library now initializes its module using Zeitwerk for autoloading and eager loading, establishing a default configuration object accessible via \SolidCache.configuration\. It also exposes an \executor\ attribute, allowing users to wrap async cache operations in a Rails executor for proper thread safety and context handling.
lib · high confidence
SolidCache store refactored into modular components with configurable key sizes and shard support
The SolidCache store implementation has been restructured into distinct modules (Api, Connections, Entries, Execution, Expiry, Failsafe, Stats) to improve maintainability and feature support. Users can now configure a maximum key byte size (defaulting to 1024 bytes) to handle long cache keys, and the store supports sharding via the \:shards\ option (with deprecation warnings for the older \:clusters\ and \:cluster\ options). The cache clearing behavior is now configurable via \:clear\_with\ (defaulting to \:truncate\ in production and \:delete\ in test environments). Additionally, the store includes improved handling of transient database errors, configurable expiry methods (\:thread\ or \:job\), and exposes connection and entry statistics.
_lib/solid\cache/store · high confidence
Support for SQL schema format in Solid Cache installation
Solid Cache now supports installation using SQL schema files in addition to migrations. The generator includes new template files for MySQL, PostgreSQL, and SQLite3 that define the \solid\_cache\_entries\ table structure directly, allowing users to initialize the cache storage via SQL dumps rather than running migration steps.
_lib/generators/solid\cache/install/templates/db · high confidence
Test coverage
Added comprehensive cache store behavior test suites; Added test fixtures for Solid Cache generator and dummy app configuration; Added test initializer for cache connections; Added tests for Solid Cache entry operations and multi-database sharding; Added tests for Solid Cache entry size estimation; Added tests for the Solid Cache installation generator; Added unit tests for Solid Cache core behaviors and configuration; Cleanup of test directory structure and removal of placeholder files; Enhanced test infrastructure with transactional test disabling and shard-aware cleanup; Removed database cache test file; Test suite updated to validate Solid Cache engine configuration; Updated dummy app environment configurations for testing; Updated test dummy database schemas for Solid Cache.
Dependencies
Expanded Appraisal configurations for Rails 7.2, 8.0, 8.1, and main
The gemfiles directory now includes dedicated Appraisal configurations for testing against Rails 7.2, 8.0, 8.1, and the main development branch. These new files pin specific Rails versions via git branches and explicitly constrain Minitest to version 5.x to ensure compatibility, allowing the library to be validated against a broader range of Rails environments.
gemfiles · high confidence
Rename gem to solid\_cache and require Rails 7.2+
The gem has been renamed from active\_support-database\_cache to solid\_cache, and its runtime dependency has been updated to require Rails 7.2 or higher (activerecord, activejob, and railties). The old gemspec has been removed, and the new gemspec defines the updated dependencies. Development dependencies have also been added, including database adapters (mysql2, pg), appraisal for testing multiple Rails versions, and a suite of rubocop gems for linting.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 55.
Lenses
- Code Health 100
- Architecture 69
- Maturity 61
- Readiness 35
- Security 99
- Domain Modelling 100
Changes since last survey
- 300 commits — 278 feature/other, 22 fixes
By area
- (root) — 108 commits
- (repo) — 74 commits
- app/models — 24 commits
- lib/generators — 19 commits
- lib/solid_cache — 19 commits
- test/unit — 17 commits
- test/dummy — 12 commits
- .github/workflows — 11 commits
- test/models — 4 commits
- bin/release — 3 commits
- db/migrate — 2 commits
- test/configs — 2 commits
- test/lib — 2 commits
- lib/active_support — 1 commit
- lib/solid_cache.rb — 1 commit
- test/test_helper.rb — 1 commit
Notable commits
- fix: Fix Gemfile.locks
- fix: Fix RemoveKeyIndexFromSolidCacheEntries migration
- fix: Fix a documentation error
- fix: Fix appraisals and bundle exec in build script
- fix: Fix for incorrect link
- fix: Fix interpolation
- fix: Fix missing bracket in readme
- fix: Fix test
- fix: Fix tests on Rails main
- fix: Merge pull request #126 from rails/fix-test-db-names
- fix: Merge pull request #136 from rails/fix-flakey-execution-tests
- fix: Merge pull request #142 from yenshirak/fix-migration
- fix: Merge pull request #148 from hahwul/fixed-link-in-readme
- fix: Merge pull request #169 from mdh/fix-typo-in-readme
- fix: Merge pull request #177 from DevStarks/README-grammar-and-punctuation-fixes
- fix: Merge pull request #185 from ollym/fix-unprepared-statements
- fix: Revert "Generate reference to the database in the cache template for all envi…"
- fix: Revert "Remove Rails 7.0 support"
- fix: RuboCop fixes
- fix: Update behavior tests and fix timeout stubbing
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
rails/solid_cache was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit da70ef4f8f9c5ad6490b3994cd4d67dcf5e3659a — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.