# Shopify/identity_cache

IdentityCache is a blob level caching solution to plug into Active Record. Don't #find, #fetch!

Repository: https://github.com/Shopify/identity_cache
Canonical: https://ross.abutalabs.com/products/identity_cache
Homepage: http://shopify.github.io/identity_cache
Language: Ruby
License: MIT
License Family: permissive
Topics: webscale, activerecord, cache
Last push: 2026-08-24T19:43:38+00:00

## Health v2 (maintenance only)
Score: 88/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 67, longevity 100
- inputs: {"age_days": 4934, "days_push": 9, "days_rel": 8, "gap_med": 227, "n_releases_24m": 4}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1968, forks 174 (observed 2026-08-28T04:06:00.695668+00:00)

## What it is
IdentityCache is a Ruby gem that adds opt-in, read-through blob caching to Active Record models, backed by Memcached. It lets you fetch records via cache indexes instead of database queries and automatically expires cached objects on changes via after_commit hooks.

## Use cases
- cache active record models in memcached
- reduce database load for hot reads in rails
- fetch records by secondary index without hitting the database
- embed associations in cached parent objects
- speed up high-traffic rails read paths

## When to choose
- you run a Rails app with heavy read traffic on Active Record models
- you already use Memcached and want model-level read-through caching
- you want automatic cache invalidation tied to record commits

## When to avoid
- you don't use Rails or Active Record
- you need write-heavy workloads where invalidation overhead dominates
- you have no Memcached or compatible cache backend available

## Facets
- artifact type: library
- maturity: stable
- function: caching, orm, database
- domain: web-development, databases, backend, performance
- platform: ruby
- tags: activerecord, memcached, read-through-cache, rails, shopify, web-server

## Member repositories
- Shopify/identity_cache (main) score 88

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:00.695668+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:05:10.711637+00:00, confidence not recorded.
  - readme: https://github.com/Shopify/identity_cache (fetched 2026-08-28T04:06:00.695668+00:00, sha a45bff607813)
  - homepage: http://shopify.github.io/identity_cache (fetched 2026-08-29T10:44:42.306218+00:00, sha d185af1dee54)
- Data as of 2026-08-30T08:39:29.467469+00:00.
