Caching stores results to avoid recomputation:
Query result caching: Snowflake and BigQuery cache recent query results. Identical queries return instantly.
Materialized views: Pre-computed aggregations. Database auto-refreshes them.
CREATE MATERIALIZED VIEW daily_sales AS
SELECT date, SUM(amount) as total
FROM orders
GROUP BY date;
Application-level caching: Cache dashboard query results in Redis. Reduce warehouse load.
Trade-offs:
- Freshness: Cached data may be stale
- Storage: Caches consume space
- Invalidation: When to refresh?