Catalogue / revenuecat-2023-memcached-cache

RevenueCat keeps memcached fast, warm and consistent with its own meta-protocol client, fail-fast reads and tracked write failures

RevenueCat, 2023. Memcached caching layer in front of the API's databases.

Organisation
RevenueCat
Evidence
Reported from production
Source
Scaling smoothly: RevenueCat's data-caching techniques for 1.2 billion daily API requests

RevenueCat blog, published 2023-10-31 (The page also shows a last-updated date of June 6, 2024 and does not say what changed.)

Records

Decision#d1

Treat a failed cache read as a miss, do not retry it on the failed server, and mark that server down for a few seconds

Decision#d2

Write an in-house memcached client because no existing one spoke the meta-command protocol

Decision#d3

Cache the hottest keys inside each web server, detected from memcached's last-access time

Decision#d4

Record failed cache writes and invalidate those keys later instead of retrying inline

Decision#d5

Shorten a key's TTL before the database write and set the new value after it

Decision#d6

Replace cache servers through a staged, clock-scheduled migration driven by the client

Sign in to read what was chosen, what was rejected and what it cost, each with its place in the source. An account is free. The job-queue cards are open without one.