[Yandex Cloud documentation](../../../../index.md) > [Yandex Data Transfer](../../../index.md) > [Step-by-step guides](../../index.md) > [Configuring endpoints](../index.md) > YTsaurus > Target

# Transferring data to a YTsaurus target endpoint

Yandex Data Transfer enables you to migrate data to YTsaurus and implement various data transfer, processing, and transformation scenarios.


There are two types of target endpoints available for YTsaurus:

* `YTSaurus Dynamic`: Writing data to [dynamic tables](https://ytsaurus.tech/docs/ru/user-guide/dynamic-tables/overview).
* `YTSaurus Static`: Writing data to [static tables](https://ytsaurus.tech/docs/ru/user-guide/storage/static-tables).


To implement a transfer:

1. [Explore possible data transfer scenarios](#scenarios).
1. [Configure one of the supported data sources](#supported-sources).
1. [Configure the target endpoint](#endpoint-settings) in Yandex Data Transfer.
1. [Create](../../transfer.md#create) a transfer and [start](../../transfer.md#activate) it.
1. Perform the required operations with the database and [control the transfer](../../monitoring.md).


## Scenarios for transferring data to YTsaurus using Yandex Data Transfer {#scenarios}

You can implement scenarios for loading data from tables into Yandex Cloud managed databases for storage in the cloud, processing, and loading into data marts for visualization.

For a detailed description of possible Yandex Data Transfer scenarios, see [Tutorials](../../../tutorials/index.md).

## Configuring the data source {#supported-sources}

Configure one of the supported data sources:

* [Apache Kafka®](../source/kafka.md) (transfer is only possible to a `YTSaurus Dynamic` target)
* [ClickHouse®](../source/clickhouse.md)
* [Greenplum®](../source/greenplum.md)
* [MongoDB](../source/mongodb.md)
* [MySQL®](../source/mysql.md)
* [PostgreSQL](../source/postgresql.md)
* [Yandex Object Storage](../source/object-storage.md)
* [Oracle](../source/oracle.md)
* [Managed Service for YDB](../source/ydb.md)

For a complete list of supported sources and targets in Yandex Data Transfer, see [Available transfers](../../../transfer-matrix.md).

## Preparing the target database {#prepare}

1. To transfer to static tables, grant permissions to create and write to tables (`write` permission for the directory with tables). If data cleanup is performed before the transfer, grant the `remove` permission. To perform a transfer, you will also need the `use` permission for the account associated with the directory the tables will be in.

1. To transfer to dynamic tables, in addition to the `write`, `remove`, and `use` permissions, grant the permission to `mount` tables.

## Configuring the YTsaurus target endpoint {#endpoint-settings}

When [creating](../index.md#create) or [updating](../index.md#update) an endpoint, you can define:

* Settings for connecting to a [Yandex Managed Service for YTsaurus cluster](#cluster). These are required parameters.
* [Advanced settings](#additional-settings).

### Supported data delivery schemas and limits {#supported-transfers}

| Data delivery schemas                                             | Support level                            | Limitations                                                                                                                                              |
|-------------------------------------------------------------------|----------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
| Delivering data to static tables                             | ![image](../../../../_assets/common/yes.svg) | Without data transformation (sharding, rotation, or splitting tables into subtables)                                                                    |
| Parallel copy of data to static tables                    | ![image](../../../../_assets/common/no.svg)  | Under development                                                                                                                        |
| Delivering data to dynamic tables through static ones          | ![image](../../../../_assets/common/yes.svg) | All intermediate operations on table parts are run as non-transactional and users can see them.<br>`Disabled` and `Drop` cleanup policy limits ^1^. |
| Parallel copy of data to dynamic tables through static ones | ![image](../../../../_assets/common/yes.svg) | All intermediate operations on table parts are run as non-transactional and users can see them.<br>`Disabled` and `Drop` cleanup policy limits ^1^. |

^1^ Cleanup policy limits:
* If the `Disabled` cleanup policy is used, there is no guarantee that new data in existing tables will take precedence over the old should the keys overlap.
* With the `Drop` policy, the old tables are cleaned up before parts of new tables are added to them. We will fix that.

{% note warning %}

For dynamic tables, primary keys in the data are a requirement. YTsaurus dynamic tables store data in `key:value` format, where the key and its associated value must also be specified. If there is no non-key column value, the `__dummy` non-key stub column will be created. If there is no primary key, the transfer will end with an error.

{% endnote %}

### Managed Service for YTsaurus cluster {#cluster}

{% list tabs group=instructions %}

- Management console {#console}

  
  * **Service account ID**: Select or [create](../../../../iam/operations/sa/create.md) a [service account](../../../../iam/concepts/users/service-accounts.md) with the `managed-ytsaurus.editor` role that Data Transfer will use to connect to the cluster.
  
  * **Cluster ID**: Select the cluster to connect to.
  
  * **Security groups**: Select the following:
      * Cloud network for hosting the endpoint.
      * [Security groups](../../../../vpc/concepts/security-groups.md) for network traffic.
  
      Security group rules apply to a transfer. They allow opening network access from the transfer VM to the cluster. For more information, see [Networking in Yandex Data Transfer](../../../concepts/network.md).

  * **Path**: Path to the folder to write the transferred data to.


  * **Cleanup policy**: Select a way to clean up data in the target database before the transfer:
    
    * `Drop`: Fully delete tables included in the transfer (default).
    
        Use this option so that the latest version of the table schema is always transferred to the target database from the source whenever the transfer is activated.
    
    * `Disabled`: Do not clean.
    
        Select this option if only replication without copying data is performed.

{% endlist %}


### Advanced settings {#additional-settings}


#### Settings for the YTSaurus Dynamic database type

{% list tabs group=instructions %}

- Management console {#console}

    * **Table settings**:

        * **Medium**: Select the [type of storage](https://ytsaurus.tech/docs/ru/user-guide/storage/media) for your data:
          
          * `HDD (primary_medium=default)`: Multiple HHD disks in a cluster.
          * `SSD (primary_medium=ssd_blobs)`: Multiple SSD disks in a cluster.
          * `SSD for logs (primary_medium=ssd_journals)`: Multiple SSD disks to store dynamic table logs.
          * `RAM (primary_medium=in_memory)`: Dedicated space in cluster node RAM.
        * **Chunk format**: Select the [format for storing data in the chunk](https://ytsaurus.tech/docs/ru/user-guide/storage/chunks#optimize_for):
          
          * `Columnar (optimize_for=scan)`: To optimize scanning.
          * `Line-by-line (optimize_for=lookup)`: To optimize search.
        * **Atomic transactions**: Enable this if you want transactions for tables to be completely [atomic](https://ytsaurus.tech/docs/ru/user-guide/dynamic-tables/transactions#atomicity) (`atomicity=full` property).
        * **TTL**: Specify a table data storage period. After this period, the data will be permanently deleted.
        * **Custom attributes**: Allows you to add custom attributes to tables created in [YSON](https://ytsaurus.tech/docs/ru/user-guide/storage/yson) format. To add a new attribute, click **+ Attribute** and enter its name and value.

    * **Write settings**:

        * **Disable schema migration**: Select to prevent changes to the target data schema when the source schema is modified. By default, when the source schema is modified, the transfer will update the target schema accordingly: create new tables, add new columns, add new enumerated values and enumerated types. By default, changes like deleting tables and columns are not applied.
        * **Discard large values**: Enable it to ignore non-critical data that fails to comply with the limits. If the size of a column value does not comply with the [YTsaurus](https://ytsaurus.tech/docs/ru/user-guide/dynamic-tables/overview#limitations) limitations, this value will be replaced with `BigStringValueStub`.
        * **Copy with static table**: Select this option to perform copy operations via temporary static tables. For the `Drop` cleanup policy, existing data in the target will be deleted once the copying is completed. If no drop mode is used, new and existing data will be merged.
        * **YT computing pool**: Specify the [computing pool](https://ytsaurus.tech/docs/ru/user-guide/data-processing/scheduler/scheduler-and-pools#puly-i-derevya-pulov) for operations on tables.

{% endlist %}

#### Settings for the YTSaurus Static database type

{% list tabs group=instructions %}

- Management console {#console}

    * **Table settings**:

        * **Chunk format**: Select the [format for storing data in the chunk](https://ytsaurus.tech/docs/ru/user-guide/storage/chunks#optimize_for):
          
          * `Columnar (optimize_for=scan)`: To optimize scanning.
          * `Line-by-line (optimize_for=lookup)`: To optimize search.
        * **Sort static tables**: Enable this option if you need to [sort table records](https://ytsaurus.tech/docs/ru/user-guide/storage/static-tables#sorted_tables) by key.
        * **Custom attributes**: Allows you to add custom attributes to tables created in [YSON](https://ytsaurus.tech/docs/ru/user-guide/storage/yson) format. To add a new attribute, click **+ Attribute** and enter its name and value.

    * **Write settings**:

        * **Discard large values**: Enable it to ignore non-critical data that fails to comply with the limits. If the size of a column value does not comply with the [YTsaurus](https://ytsaurus.tech/docs/ru/user-guide/dynamic-tables/overview#limitations) limitations, this value will be replaced with `BigStringValueStub`.
        * **YT computing pool**: Specify the [computing pool](https://ytsaurus.tech/docs/ru/user-guide/data-processing/scheduler/scheduler-and-pools#puly-i-derevya-pulov) for operations on tables.

{% endlist %}

After configuring the data source and target, [create and start the transfer](../../transfer.md#create).