ContentsThe pattern

Guide · The pattern

The pattern

Every table that the migration builds goes through the same three zones, and every row in scope is accounted for on the way.

Also called "the ETL design" or "the migration architecture" · the three zones are "the landing zone", "staging" and "the load-ready table". Terminology

Source

As it arrived. Unchanged.

keyterms
C-101N30
C-102n 30
C-10345 DAYS

Transform table

The shape of the target, and wide: the new value, with the old value beside it.

keytermsold valuerejected
C-101NET30N30no
C-102NET30n 30no
C-10345 DAYSyes

Load table

The rows that passed the checks.

keyterms
C-101NET30
C-102NET30

then to the target

The catch tray

C-10345 DAYSNo mapping yet for this value

The flagged rows of the transform table, each with its reason. A row that the target refuses comes back here too, with the reason that the target gave.

On every row: where it came from · its key in the source · rejected or not, and why

3 rows in scope = 2 rows loaded + 1 row rejectedThe rows are an example.

The same picture, as text
 SOURCE               TRANSFORM TABLE                 LOAD TABLE
 as it arrived   ──►  the shape of the target   ──►   the rows that     ──►  the target
 unchanged            and wide: the new value,        passed the checks       │
                      with the old value beside it                            │ a row that the
                             │                                                │ target refuses
                             ▼  a row that fails a check                      ▼ comes back
                      THE CATCH TRAY   the flagged rows, each with its reason

 on every row:   where it came from · its key in the source · rejected or not, and why

 3 rows in scope = 2 rows loaded + 1 row rejected

 The rows are an example.
With AI

An AI writes the SQL for each table to this pattern, and Convago runs it and counts the rows. A person reads the result. Because every table is built the same way, a person can read what the AI built.

See how it is done with Convago

Why

  • One wayBuild each table the same way. A second way to build a table is a second thing to learn, to test and to hand over.
  • The landed copy is not editedA fix in the migration is a rule in the transform. A fix in the old system comes in with the next extract. A change made by hand in the landed copy is lost with the next extract.
  • The old value stays in viewThe new value and the old value are in the same row. Without the old value, a wrong value means a search back through the source.
  • The count closesRows in scope = rows loaded + rows rejected, on every run. When the count does not close, a row has been lost or counted twice, and it has to be found before the load can be trusted.
ScenarioOne way

A person who has built the customer table moves to the vendor table. Its columns and its rules are different, but the landing, the flags, the count and the load table are the same, so the person can build it without help.

ScenarioThe old value stays in view

A payment term arrives as "N30". The transform table holds "NET30", with "N30" beside it. When someone asks where NET30 came from, the answer is in the row.

ScenarioThe count closes

3 rows are in scope. 2 load. 1 is rejected: its payment term has no mapping yet. 2 loaded and 1 rejected make the 3 in scope.

How

  • Land the source as it isChange nothing on the way in.
  • Set the scope one timeLand every row. Filter one time, where the transform reads the source. Count the rows that are left out. Each later step takes only the rows in scope.
  • Shape for the targetGive the transform table the columns of the target.
  • Keep the old valueWrite the new value in the column of the target. Keep the old value beside it.
  • Mark every rowEach row carries three things: the source table it came from, its key in that table, and whether it is rejected, with the reason.
  • Flag, and go onCheck each row against what the target takes. A row that fails stays in the transform table, flagged, with its reason. The flagged rows are the catch tray. The run goes on.
  • Load what passedThe load table takes the rows that passed, in the exact shape of the target.
  • Keep the rules in the transformA rule that changes a value belongs in the transform, and nowhere else. So there is one place to look.
  • Bring back what the target refusedA row that the target refuses goes to the catch tray, with the reason that the target gave. It is counted as rejected.
  • Count a plug apartA plug has no row in the source. It is flagged as a plug, and it is not in the count of rows.

More