NewWork mode: your Claude Code or Codex on work calls, answering from your project's codeSkip to content
Middle+0 views

Was critical data stored only in the cache, or was it also duplicated in persistent storage?

Practice

AI answer

A cache should not be the only place where data that must not be lost is stored: it can be cleared, evicted due to limits, or lost in a failure. The source of truth should be persistent storage—for example, a database or object storage—and the cache should be recoverable from it. If consistency and freshness matter, define cache invalidation or refresh rules, an acceptable TTL, and behavior when the cache is unavailable. For data that is inherently temporary and can be lost, the cache can serve as the primary store, but this must be explicitly documented as a requirement rather than assumed.