From log record
to committed row.
TwinCommit works by reading the source database's transaction log, buffering changes until their transaction commits, and applying each transaction to the target together with its checkpoint. Here's every stage.
- 1capture
Log reader
Reads log records through the database's native log API (db2ReadLog, redo, the SQL Server transaction log or pgoutput) and decodes row images in-process. Nothing is installed in the database.
- 2assemble
Transaction buffer
Groups changes by transaction ID. Rollbacks, including partial rollbacks to a savepoint, are discarded here and never reach the target.
- 3protect
Spill manager
Transactions larger than max_txn_memory_bytes spill to local disk, so a 50-million-row batch never exhausts memory and still applies atomically.
- 4deliver
Commit-ordered apply
On COMMIT, the transaction is applied to the target as one unit, in source commit order, using that platform's fastest transactional write path.
- 5guarantee
In-target checkpoint
The log position is written in the same target transaction as the data, so a crash can never separate "data applied" from "position saved". That is how delivery stays exactly-once.
Guarantees
What TwinCommit promises, and why it holds.
No lost transactions
Restart resumes from the checkpoint committed with the last applied transaction.
No duplicate transactions
Upsert-by-key apply makes replay idempotent, and the in-transaction checkpoint prevents replay entirely.
No partial transactions
Targets see a whole transaction or none of it.
No ordering surprises
Transactions are applied in source commit order.
Resilience
Built to be killed.
The TwinCommit test suite kills the process with SIGKILL mid-workload, mid-snapshot and mid-spill, then proves source and target match row for row.
$ twincommit run -config prod.yaml &
$ kill -9 $! # mid-transaction, 1.8M rows in flight
$ twincommit run -config prod.yaml
{"level":"info","msg":"resuming from checkpoint","lsn":"0x0004F311","txn":81231}
$ twincommit verify -config prod.yaml
✓ 214 tables match · 0 missing · 0 extra · 0 differingReplicate your first table in five minutes.
Download the free Developer edition, or have one of our replication engineers walk you through a migration plan.