Back to feed
Dev.to
Dev.to
7/7/2026
The original title is: "Live, Snapshot, Cache: revisiting the 3-way decision after 60 days of running it"

The original title is: "Live, Snapshot, Cache: revisiting the 3-way decision after 60 days of running it"

Original: Live, Snapshot, Cache: revisiting the 3-way decision after 60 days of running it

Short summary

An engineer shares a production-tested three-category framework for classifying database values: Live (compute on-the-fly via views), Snapshot (store immutable, never recalculate—essential for audit and billing), and Cache (store with declared refresh mechanisms). Over 60 days, this rule prevented three production bugs: a retroactive pricing recalculation that would have destroyed audit history, an unrefreshed cached column, and premature materialization. The framework fails at object coherence—mixing transient and immutable fields—fixed by resetting state in the same transaction.

  • Three-category classification: Live (on-the-fly compute), Snapshot (immutable store), Cache (store with declared refresh mechanism)
  • Prevented three production bugs including audit-breaking retroactive recalculation, unrefreshed cache drift, and unnecessary materialization
  • Framework works column-by-column but breaks at object level when mixing state types; author's fix resets transient fields atomically

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more