13. Serving, activation and cost
One-liner. Data earns its keep only when it reaches a decision — and the bill is in storage layout.
Memorize
- BI: warehouse marts + semantic layer (metrics defined once).
- Reverse ETL: push segments back to CRM/ads (Census, Hightouch) — treat as a pipeline with idempotency.
- Feature store: offline (training) + online (low-latency) parity; point-in-time correctness avoids leakage.
- APIs: precomputed tables for latency; never query the lake per request.
- Cost drivers: small files, over-partitioning, full scans, idle warehouses, cross-Region egress.
- Fix layout first (target 128 MB–1 GB files, cluster/partition by query predicates), then compute.
- Track cost per dataset and cost per pipeline run; delete unused tables.
Trap. Over-partitioning "for performance" — thousands of tiny partitions make planning slower and cost more. Do this. Size files before adding partitions; measure bytes scanned per query.
Check
A feature used in training and online serving shows different values in production. What is the standard fix?
Why
Training/serving skew comes from two implementations; one definition with time-correct joins fixes it.