Skip to content

Shadow Mode

Shadow mode writes pipeline output to shadow tables instead of (or alongside) production tables. This lets you validate changes — new logic, schema migrations, adapter upgrades — without affecting production data.

  1. Rocky rewrites target table names by appending a suffix (default: _rocky_shadow) or routing to a dedicated schema
  2. The pipeline runs normally, writing to shadow targets
  3. A comparison engine checks row counts, schemas, and optionally sample data between shadow and production
  4. Results show pass/warn/fail with detailed diffs
production: analytics.marts.fct_revenue
shadow: analytics.marts.fct_revenue_rocky_shadow
production: analytics.marts.fct_revenue
shadow: analytics.rocky_shadow.fct_revenue

Schema override keeps the table name clean and groups all shadow tables together.

The comparison evaluates three dimensions:

Compares the number of rows between shadow and production:

shadow: 148,203 rows
production: 148,205 rows
diff: -2 rows (-0.001%)
verdict: PASS (within 0.01% threshold)

Compares column names, types, and order:

Diff TypeDescription
ColumnAddedColumn in shadow but not production
ColumnRemovedColumn in production but not shadow
ColumnTypeDiffSame column, different type
ColumnOrderDiffSame columns, different order

Hash-based comparison of sample rows to detect value differences even when row counts match.

Configure pass/warn/fail thresholds:

ThresholdDefaultDescription
row_count_diff_pct_warn0.01 (1%)Warn if row count differs by more than this
row_count_diff_pct_fail0.05 (5%)Fail if row count differs by more than this
allow_column_order_difftrueWhether column reordering is acceptable
VerdictMeaning
PassAll comparisons within thresholds
WarnMinor differences detected (e.g., row count within warn threshold, column order change)
FailSignificant differences (e.g., row count beyond fail threshold, missing columns, type changes)
  • Schema migrations: Verify a column rename doesn’t change output
  • Logic changes: Compare old vs new calculation results
  • Adapter testing: Validate a new warehouse adapter against the production adapter
  • dbt migration: Compare Rocky output against dbt output (via rocky validate-migration)