explaingit

rails/solid_cache

Analysis updated 2026-05-18

1,019RubyAudience · developerComplexity · 2/5Setup · easy

TLDR

A database backed cache store for Ruby on Rails that lets applications keep a much larger cache on disk instead of a small one in memory.

Mindmap

mindmap
  root((repo))
    What it does
      Disk backed cache store
      Replaces Redis or Memcached
      Auto expires old entries
    Tech stack
      Ruby on Rails
      ActiveRecord
      SQL databases
    Use cases
      Rails 8 default cache
      Sharded large caches
      Dedicated cache database
    Audience
      Rails developers
    Setup
      bundle add solid_cache
      Install generator

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Replace Redis or Memcached as the Rails cache store to fit a much bigger cache on disk.

USE CASE 2

Automatically install into new Rails 8 apps as the default cache store.

USE CASE 3

Shard the cache across multiple databases for large scale applications.

USE CASE 4

Configure a dedicated cache database separate from the main app database.

What is it built with?

RubyRailsActiveRecordSQLiteMySQLPostgreSQL

How does it compare?

rails/solid_cachesds/mock_redisfastlane/watchbuild
Stars1,019505328
LanguageRubyRubyRuby
Last pushed2026-06-222021-10-26
MaintenanceActiveDormant
Setup difficultyeasyeasyeasy
Complexity2/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Needs a database migration step, sharding across multiple databases takes more configuration.

Not stated in the README.

In plain English

Solid Cache is a cache store for Ruby on Rails applications that stores cached data in a regular database table instead of in memory. Rails already ships with cache stores backed by Redis or Memcached, which keep everything in RAM. Solid Cache takes a different approach: modern solid state drives are fast enough that reading from disk barely costs anything compared to reading from memory, so you can afford to keep a much bigger cache than would ever fit in RAM. Starting with Rails 8, Solid Cache is configured automatically in new applications. For earlier Rails versions, adding it is a two step process: add the gem with bundle add, then run the install generator, which sets up the production cache store and creates the database migration files needed for a cache table. You point Solid Cache at a database using a config file, either config/cache.yml or config/solid_cache.yml, and you can use a dedicated cache database, split the cache across multiple database shards, or just reuse your existing primary database connection. The cache is configurable in the usual Rails cache way, with options like a maximum age for entries, a maximum entry count, and a maximum total size in bytes. To keep the cache from growing forever, Solid Cache tracks how many writes have happened and periodically runs a background cleanup task, either on a background thread or as a queued job, that deletes old entries once the cache passes its size or age limits. For larger applications, Solid Cache can shard the cache across several databases using a consistent hashing scheme so that entries are spread out evenly and shards can be added or removed without disrupting the whole cache. This project comes from the official Rails organization and is meant as a drop in replacement wherever a traditional Rails cache store would normally be used.

Copy-paste prompts

Prompt 1
Help me install and configure Solid Cache in an existing Rails 7 app.
Prompt 2
Show me how to shard the Solid Cache database across two databases.
Prompt 3
Explain how Solid Cache decides when to expire old cache entries.
Prompt 4
Write a config/cache.yml for Solid Cache with a 30 day max age.

Frequently asked questions

What is solid_cache?

A database backed cache store for Ruby on Rails that lets applications keep a much larger cache on disk instead of a small one in memory.

What language is solid_cache written in?

Mainly Ruby. The stack also includes Ruby, Rails, ActiveRecord.

What license does solid_cache use?

Not stated in the README.

How hard is solid_cache to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is solid_cache for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.