Skip to content

Table synchronisation

Keeping a table in step with another copy sounds simple until a run fails halfway. Here’s what to think about, and what SQL Cockpit can do on each engine.

The problem

Hand-written sync scripts work until something changes: a new column, a late-arriving row or a failed run nobody noticed. Then you’re left working out which rows are right.

Recognise the symptoms

  • Scripts that only one person understands
  • Target tables that quietly drift from the source
  • Full reloads because nobody trusts the incremental run
  • Failures found by the people using the data

A practical approach

  1. Choose how changes are detected

    Decide between a watermark column, change tracking, a key comparison or a full reload, and know what each one can miss.

  2. Decide what happens to deletes and conflicts

    Be explicit about deleted rows and which side wins. These are the cases that cause drift later.

  3. Size the batches

    Test batch sizes against the real table, so that the sync doesn’t get in the way of normal work.

  4. Reconcile regularly

    Compare source and target on a schedule, so you find drift before anyone relying on the data does.

Table synchronisation by technology

SQL Server

Available: Set up, run and check table syncs between SQL Server databases, with state kept between runs.

Replication and change tracking, where they suit the job.

PostgreSQL

Not available yet: No table data sync yet.

Logical replication.

MySQL

Not available yet: No table data sync yet.

Replication, with filters for the tables you need.

MariaDB

Not available yet: No table data sync yet.

Replication, with filters for the tables you need.

Oracle

Not available yet: No table data sync yet.

Materialized views, or GoldenGate where you’re licensed for it.

SQLite

Not available yet: No table data sync yet.

SQLite’s session extension, or application-level sync.

What success looks like

Syncs that you can see, restart and check, without depending on one person’s script.

SQL Cockpit’s table sync is for SQL Server. On other engines, its “object sync” updates the search index and doesn’t copy table data.