Transfer types and lifecycles
A transfer lifecycle includes various statuses following one another in the order determined by the transfer type.
Transfer types
The following types of transfers are available:
- Snapshot: Transfers a snapshot of the source to the target. Apart from a one-time snapshot transfer, there are copy types, such as Regular and Regular incremental.
- Replication: Continuously receives changes from the source and applies them to the target. Initial data synchronization is not performed.
- Snapshot and increment: Transfers the current state of the source to the target and keeps it up-to-date.
The transfer type you select depends on data changes on the source endpoint, requirements for the frequency of data delivery, and the relevance of data.
Copy
The Snapshot transfer is designed for transferring the state of the source database to the target without keeping it up-to-date. Changes occurring on the source after the transfer is completed will not be transferred. This type of transfer can prove useful when there is no writing load on the source or no need to keep the target database up-to-date, e.g., when deploying test environments.
When the transfer is ready, its status automatically switches to Copying. It is maintained until all data in the source is transferred to the target. Then the transfer is automatically deactivated and switches its status to Completed.
The transition between statuses for the Snapshot transfer type is shown below:
Yandex Data Transfer supports three types of data copy:
- Single: Copies all data from the source to the target when activating a transfer. Data is copied in descending order of table size (the largest tables are copied first). This type of copy may take a long time if the amount of data to transfer is large. In addition, one-time copying does not factor in data changes. You can recopy the data only after the previous operation is completed.
- Regular: Copies all data from the source to the target at certain time intervals. This copy method allows you to set up regular data delivery. It is recommended for small frequently modified tables.
- Regular incremental: Copies to the target at certain time intervals only the data that has been modified in the source since the previous copy. This approach allows you to arrange data delivery to the target with the minimum possible latency and load on the data source. However, it does not allow you to factor in data delete operations in the source. For more information, see Regular incremental copy.
Replication
The Replication transfer is designed for transferring changes from the source to the target without completely copying all data; when the transfer is activated, only the data schema will be transferred.
When the transfer is ready, its status automatically switches to Replicating, which is maintained indefinitely. Changes occurring in the source are automatically transmitted to the target.
The transition between statuses for the Replication transfer type is shown below:
Copy and replication
The Snapshot and increment transfer combines the features of the Snapshot and Replication transfers, i.e., the source data is completely transferred to the target and is kept up-to-date. Typically, such transfers are used in migration scenarios.
Once a transfer is set and activated, it will automatically update its status to Copying. It is maintained until all data in the source is transferred to the target.
Then the status of the transfer switches to Replicating: all changes occurring on the source are automatically transferred to the target.
The transition between statuses for the Snapshot and increment transfer type is shown below:
Statuses
The current transfer status determines available actions with transfers. For more information, see Managing transfer process.
-
Created: Assigned to a transfer immediately after creation.
-
Creating: Assigned to a transfer after activation.
At this time, the service checks the connection to the source and target and creates the resources necessary for the transfer. Depending on the transfer type and endpoint settings, additional actions may be available, e.g., creating replication slots, copying a data schema, and so on.
-
Stopping: Assigned to the transfer after deactivation.
At this time, the service performs the actions necessary to properly disconnect from the source and target. Depending on the transfer type and endpoint settings, additional actions may be performed, e.g., closing replication slots, transferring triggers, stored procedures, and functions, creating indexes in the target database, etc.
-
Stopped: Assigned to the transfer after deactivation is complete.
Only successful transfer deactivation guarantees the operability of the target and the source.
-
Copying: Assigned to Snapshot and Snapshot and increment transfers for the period while data is copied from the source.
-
Replicating: Assigned to Replication and Snapshot and increment transfers.
- Replication: After a successful activation.
- Snapshot and increment: After successfully copying data from the source.
-
Completed: Assigned to transfers that have successfully transferred the data.
-
Error: Assigned to the transfer if any issues occur.
A transfer's status may switch to Error during activation, data replication, or copying. Depending on the status that preceded the error, the transfer can be reactivated. Errors may occur both on the source and the target.
Learn more about possible error causes and how to resolve them in Troubleshooting in Data Transfer.