invantive documentationpart of invantive cloud
Invantive Support ForumsLog In / Sign Up

Synchronizing Data

Copying a table from one platform to another once is an insert over a select; keeping the two equal over time is something else, and is what the synchronize statement is written for. It compares the two sides and sends only what differs.

Why Not an Insert

An insert ... select repeated every night inserts everything every night. Against a database that is wasteful; against a cloud platform which is charged per call it is expensive, and it does not remove what has been deleted on the source either. Synchronizing compares first: what is new is inserted, what changed is updated, what is gone is deleted where that is asked for.

Running One in the Editor

A synchronize statement runs from a document like any other statement, and everything the product shows applies to it:

  • Progress draws the comparison and the writing as separate steps, so where the time goes is visible while it runs;
  • Connection Monitor lists the calls, and "Group by Request" counts them per request, which is the honest measure of what a synchronisation costs on a cloud platform;
  • the status bar and History state how many rows were affected.

Where It Belongs Afterwards

A synchronisation which is worth running once is worth running on a schedule, and that is Invantive Data Hub with the same statement in a file. The editor is where it is written and watched; the scheduler is where it lives.

For a copy which only has to be fast to read, rather than equal to the source, the data cache is the lighter instrument: it is maintained by the engine and needs no statement of its own.

Release Notes