Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions content/docs/running-replicant.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,18 @@ The following table lists the supported write modes and the corresponding Replic
`TRUNCATE`
: If the table exists in the destination database, Replicant preserves destination table schemas, but replaces the destination data with the source data.

### Behavior in different replication modes
The following table lists how each write mode behaves in different replication modes:

| Write mode | Full | Real-time | Snapshot | Delta-snapshot |
|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|
| `APPEND` | If source table does not exist on target, Replicant creates the table. If source table exists on target, then Replicant performs insert, update, and delete operations on the same table. | Same as full mode | If source table does not exist on target, Replicant creates the table. If source table exists on target, Replicant inserts rows into the same table | Same as full mode. |
| `MERGE` | If source table does not exist on target, Replicant creates the table. If table exists and has primary key, then Replicant performs upsert. If table exists without primary key, then Replicant truncates the table and performs insert operations. | Replicant ignores `MERGE` write mode if you specify and instead uses `APPEND` write mode. | Same as full mode. | Same as full mode. |
| `REPLACE` | If source table does not exist on target, Replicant creates the table. If table exists on target, Replicant drops the table and creates the table during initialization phase. | Same as real-time mode for `MERGE`. | Same as full mode. | Same as full mode. |
| `SWAP` | See [How `SWAP` write mode works](#how-write-modes-work). | | | |
| `TRUNCATE` | If source table does not exist on target, Replicant creates the table. If table exists on target, Replicant truncates the table during initialization phase. | Same as real-time mode for `MERGE`. | Same as full mode. | Same as full mode |


### Additional flags and features
- You can provide the `--lazy-init` flag while using `--truncate-existing` or `--replace-existing`. This instructs Replicant to replace the existing data at the last moment. By default, Replicant removes the existing data during Replicant's initialization phase.
- Replicant has another write mode `--synchronize-deletes` that only applies to [delta-snapshot replication](#replicant-delta-snapshot-mode). When you start Replicant in `delta-snapshot` mode with the `--synchronize-deletes` flag, the following events occur:
Expand Down