Cloud Parts

Cache or database?

DimensionCachingRelational databases
Source of truthNo, a copyYes
Survives a restartMaybe; assume it doesn’tYes, durably
Typical read latencyUnder 1 msMilliseconds or more, depending on the query
HoldsWhat fits in memoryTerabytes on disk
FreshnessMay be stale until TTL or invalidationCurrent and transactional

Rule of thumb

Design so the app still works, only slower, if the cache is empty. If losing the cache would lose data, it isn’t a cache any more.

Sources