Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Data Transfer
  • Available transfers
  • Getting started
    • All tutorials
      • MySQL® to Apache Kafka®
      • MySQL® to YDS
      • PostgreSQL to Apache Kafka®
      • PostgreSQL to YDS
      • YDB to Apache Kafka®
      • YDB and delivery to YDS
  • Troubleshooting
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials

In this article:

  • Required paid resources
  • Getting started
  • Prepare the Managed Service for YDB source database
  • Create a target stream in Data Streams
  • Set up and activate the transfer
  • Test the transfer
  • Delete the resources you created
  1. Tutorials
  2. Change data capture and delivery to the queue
  3. YDB and delivery to YDS

YDB change data capture and delivery to YDS

Written by
Yandex Cloud
Updated at January 15, 2026
  • Required paid resources
  • Getting started
  • Prepare the Managed Service for YDB source database
  • Create a target stream in Data Streams
  • Set up and activate the transfer
  • Test the transfer
  • Delete the resources you created

A Data Streams stream can get data from Managed Service for YDB databases in real time using the Change Data Capture (CDC) technology.

Note

In YDB, CDC mode is supported starting from version 22.5.

To set up CDC using Data Transfer:

  1. Prepare the Managed Service for YDB source database.
  2. Create a target stream in Data Streams.
  3. Set up and activate the transfer.
  4. Test your transfer.

If you no longer need the resources you created, delete them.

Required paid resourcesRequired paid resources

  • Managed Service for YDB databases (see Managed Service for YDB pricing). The cost depends on deployment mode:

    • In serverless mode, you pay for data operations and storage volume, including stored backups.
    • In dedicated instance mode, you pay for the use of computing resources allocated to the database, storage size, and backups.
  • Data Streams (see Data Streams pricing). The cost depends on the pricing model:

    • Based on allocated resources: You pay a fixed hourly rate for the established throughput limit and message retention period, and additionally for the number of units of actually written data.
    • On-demand: You pay for the performed read/write operations, the amount of read or written data, and the actual storage used for messages that are still within their retention period.

Getting startedGetting started

Set up the infrastructure:

Manually
Terraform
  1. Create a Managed Service for YDB source database in any suitable configuration.

  2. If you selected Dedicated DB mode for the source, create and configure a security group in the network hosting the DB.

  3. Create a Managed Service for YDB database in any suitable configuration for the Data Streams target stream.

  1. If you do not have Terraform yet, install it.

  2. Get the authentication credentials. You can add them to environment variables or specify them later in the provider configuration file.

  3. Configure and initialize a provider. There is no need to create a provider configuration file manually, you can download it.

  4. Place the configuration file in a separate working directory and specify the parameter values. If you did not add the authentication credentials to environment variables, specify them in the configuration file.

  5. Download the data-transfer-ydb-yds.tf configuration file to the same working directory.

    This file describes:

    • Network.
    • Subnet.
    • Security group and the rule required to connect to the Managed Service for YDB database.
    • Managed Service for YDB source database.
    • Managed Service for YDB database for the target stream.
    • Transfer.
  6. In the data-transfer-ydb-yds.tf file, specify the following variables:

    • source_db_name: Managed Service for YDB source database name.
    • target_db_name: Name of the Managed Service for YDB database for the target data stream.
    • transfer_enabled: 0 to ensure that no transfer is created before you create the endpoints.
  7. Validate your Terraform configuration files using this command:

    terraform validate
    

    Terraform will display any configuration errors detected in your files.

  8. Create the required infrastructure:

    1. Run this command to view the planned changes:

      terraform plan
      

      If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

    All the required resources will be created in the specified folder. You can check resource availability and their settings in the management console.

Prepare the Managed Service for YDB source databasePrepare the Managed Service for YDB source database

  1. Get ready for running SQL queries in the Managed Service for YDB source database:

    Management console
    YDB CLI
    1. In the management console, select the folder containing your database.
    2. From the list of services, select Managed Service for YDB.
    3. Select the database from the list and go to the Navigation tab.
    4. Click New SQL query.
    1. Set up a connection to the Managed Service for YDB database.

    2. Make sure you can run queries using the YDB CLI with the selected authentication mode. For example, for an OAuth token, run the following query:

      ydb \
        --endpoint <endpoint> \
        --database <DB_name> \
        --yc-token-file <path_to_OAuth_token> \
        yql -s "SELECT 1;"
      

      Result:

      ┌─────────┐
      | column0 |
      ├─────────┤
      | 1       |
      └─────────┘
      
  2. Create a table for test data:

    CREATE TABLE test
    (
        id Uint64,
        text Utf8,
        PRIMARY KEY (id)
    );
    

Create a target stream in Data StreamsCreate a target stream in Data Streams

Create a stream for the Data Streams.

Set up and activate the transferSet up and activate the transfer

  1. Create an YDB source endpoint:

    • Connection settings:

      • Database: Select the Managed Service for YDB database from the list.
      • Service account ID: Select an existing service account or create a new one with the ydb.editor role.
    • Included paths list:

      • Path 1: test.
  2. Create an endpoint for the Yandex Data Streams target:

    • Connection settings:

      • Database: Select the Managed Service for YDB database for the target stream from the list.
      • Stream: Specify the name of the stream in Data Streams.
      • Service account: Select an existing service account or create a new one with the yds.editor role.
    • Serializing settings: Auto.

  3. Create a transfer:

    Manually
    Terraform
    1. Create a Replication-type transfer configured to use the new endpoints.
    2. Activate the transfer.
    1. In the data-transfer-ydb-yds.tf file, specify the following variables:

      • source_endpoint_id: ID of the source endpoint.
      • target_endpoint_id: ID of the target endpoint.
      • transfer_enabled: 1 to create a transfer.
    2. Validate your Terraform configuration files using this command:

      terraform validate
      

      Terraform will display any configuration errors detected in your files.

    3. Create the required infrastructure:

      1. Run this command to view the planned changes:

        terraform plan
        

        If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

      2. If everything looks correct, apply the changes:

        1. Run this command:

          terraform apply
          
        2. Confirm updating the resources.

        3. Wait for the operation to complete.

      The transfer will activate automatically upon creation.

Test the transferTest the transfer

  1. Wait for the transfer status to change to Replicating.

  2. Add the test data to the test table in the Managed Service for YDB source database:

    INSERT INTO test
    (
        id,
        text
    )
    VALUES
    (
        1,
        'text 1'
    ),
    (
        2,
        'text 2'
    ),
    (
        3,
        'text 3'
    );
    

Make sure the data from the source has been moved to the Data Streams stream:

Management console
AWS CLI
  1. In the management console, select Data Streams.
  2. Select the target stream from the list and navigate to  Data viewer.
  3. Make sure shard-000000 now contains messages with the source table rows. For a closer look at the messages, click .
  1. Install the AWS CLI.

  2. Configure the environment for Data Streams.

  3. Read the stream data using:

    • AWS CLI.
    • AWS SDK.

Delete the resources you createdDelete the resources you created

Note

Before deleting the created resources, deactivate the transfer.

To reduce the consumption of resources you do not need, delete them:

  1. Delete the transfer.

  2. Delete the source and target endpoints.

  3. If you created service accounts together with the endpoints, delete them.

  4. Delete other resources using the same method used for their creation:

    Manually
    Terraform
    1. Delete the Managed Service for YDB source database.
    2. Delete the Managed Service for YDB database used for the target stream.
    1. In the terminal window, go to the directory containing the infrastructure plan.

      Warning

      Make sure the directory has no Terraform manifests with the resources you want to keep. Terraform deletes all resources that were created using the manifests in the current directory.

    2. Delete resources:

      1. Run this command:

        terraform destroy
        
      2. Confirm deleting the resources and wait for the operation to complete.

      All the resources described in the Terraform manifests will be deleted.

Was the article helpful?

Previous
YDB to Apache Kafka®
Next
Apache Kafka® to ClickHouse®
© 2026 Direct Cursus Technology L.L.C.