A database-backed ActiveSupport::Cache::Store
open sourceMITself-hostablefree
Solid Cache is a Rails cache store that keeps the cache in a SQL database (PostgreSQL, MySQL or SQLite) instead of memory, so it can hold a far larger cache on cheap SSD storage than Redis or Memcached would. It's the default cache store in new Rails 8 apps, with a cache database of its own, expiry by age or size done in the background as it writes, sharding across databases and encryption. 37signals built it for Basecamp and HEY, where the cache is six times larger than the old Redis cache on storage that costs 80% less, with reads about 40% slower.
Problems it solves
- our Redis cache is expensive and only holds a few days of fragments
- cache weeks of rendered fragments instead of hours by keeping the cache on disk
- run caching in a Rails app without operating Redis or Memcached
- what cache store does a new Rails 8 app use by default
- a cache on SQLite for a small Rails app on one server
- spread a large cache across several databases
- encrypt cached data at rest because it may contain personal information
- expire cache entries by age and by total size without a cron job
Features
- Active Support cache store backed by MySQL, PostgreSQL or SQLite
- default cache store in Rails 8
- separate cache database
- expiry by max age and max size, run in the background
- sharding across databases
- encryption
- installer that writes config/cache.yml and the schema
Alternatives
The same job
These do what Solid Cache does.
