Snapshots
A snapshot copies a table’s current contents to the target and records the exact log position from which streaming must continue. You run it once per table at setup, and again for any table that becomes broken.
What happens during a snapshot
Section titled “What happens during a snapshot”- TwinCommit takes a brief share lock on the table.
- While no writer is mid-transaction on the table, it records the current log position.
- It releases the lock. Writers are blocked only for this short window.
- It bulk-copies the rows to the target, for example with binary COPY on PostgreSQL or staged Parquet plus MERGE on Databricks.
- It marks the table
streamingfrom the recorded position.
Changes committed while the copy runs are picked up by the stream. Because apply is idempotent, a change that is in both the copy and the stream leaves the same result. See exactly-once.
Commands
Section titled “Commands”# all tables in the pipelinetwincommit snapshot -config pipeline.yaml
# just one or more tablestwincommit snapshot -config pipeline.yaml -tables SALES.ORDERS,SALES.ORDER_LINESTips for large tables
Section titled “Tips for large tables”- Run snapshots during quieter periods; the copy reads the whole table.
- Make sure the source keeps enough log to cover the snapshot’s duration.
- Use
exclude_columnsfor unsupported column types rather than skipping the table.