Skip to main content

Migrate & Monitoring

Migrate moves dbt models from one warehouse to another - for example from Snowflake to Spark. An agent translates each model into the new warehouse's SQL and opens a pull request. Monitoring then compares the new tables with the old ones, window by window, so you can tell when the new side is safe to rely on.

Migrating models​

Setting up a migration​

A migration links two environments:

  • Source - the repository and warehouse to translate models from. Zingle only reads it.
  • Destination - the repository and warehouse to write translated models into.

Translating​

Open a chat in the migration and tell the agent what to move, for example "migrate the orders marts". The Migrate agent:

  1. Reads the source models.
  2. Rewrites them in the destination warehouse's SQL, following the destination project's conventions.
  3. Checks they compile, and adds each one to the migration's model mapping (source model → destination model). Models that don't map one-to-one are marked for manual checking.

For each model you can compare the data on both sides: Zingle builds the translated model in a scratch area of the destination and compares it with the source table - row counts, columns, and values. When you're happy, open a pull request to the destination repository.

Monitoring a table pair​

A one-off comparison shows that a table matches today. A monitor keeps comparing a source table with its destination table over time, so differences that only show up on some days are caught before you switch.

Creating a monitor​

From a migration, choose Compare a table pair and set:

SettingWhat it means
Source and DestinationThe two tables to compare.
Time column for windowsThe date or time column on each side that splits the data into windows.
Compare everyHow long each window is - for example one hour or one day.
LagHow long after a window ends before it is compared, so late rows have landed on both sides.
Watch rangeThe period to watch. It can start in the past, so recent history is compared right away.
Column mappingWhich source column matches which destination column. Zingle suggests pairs; columns you don't need can be ignored.
ToleranceHow big a difference to accept, as a percentage of the source value. 0 means exact.

What it compares​

For each window, Zingle profiles both tables and compares:

  • Row counts.
  • Columns - columns missing on one side, or whose type changed.
  • Values - per column: nulls, distinct values, minimum and maximum, averages, and the mix of values in text columns.

Each window gets a verdict, and the monitor shows a status:

StatusMeaning
On trackThe latest window matched.
Needs attentionThe latest window found a difference.
RunningA comparison is running now.
Watch endedEvery window in the watch range has been compared.
ArchivedThe monitor was stopped.

Monitors run in the background. If a comparison fails - for example the warehouse is busy - it is retried with growing gaps, and a window that keeps failing is recorded as failed so the rest can move on.

Summary and investigation​

  • Summary - after the data changes in a way you would notice, the Monitoring Analyst agent writes a short summary: what differs, why, which differences are real data gaps and which are just how the two warehouses work, and whether the destination can replace the source. You can also ask for a fresh summary.
  • Investigate - open a chat with the Monitoring Analyst to dig into a difference. The agent can query both sides and, when you ask, fix a model and open a pull request. Investigation chats are private to you until you share them.

Monitoring only reads the two warehouses. The source side is never written to, and production stays read-only. See the Production safety model.