Skip to main content

MySQL to StarRocks Real-Time Synchronization | NineData

StarRocks is commonly used as an analytical database for high-concurrency queries, dashboards, and real-time data warehouse workloads. When MySQL remains the transactional source, NineData Data Replication can replicate MySQL data to StarRocks through schema replication, full data replication, and incremental replication.

This workflow helps you initialize StarRocks from MySQL and then keep StarRocks updated as source-side data changes.

When to use this workflow

Use this workflow to:

  • Build a StarRocks analytics layer from MySQL business data.
  • Run reporting or ad-hoc analytics without sending heavy queries to MySQL.
  • Migrate selected MySQL tables to StarRocks with schema and data replication.
  • Keep StarRocks updated after the initial full load.
  • Validate synchronized data before it is used by downstream teams.

Overview

NineData runs the synchronization in stages:

  1. Register the MySQL source and StarRocks target as data sources.
  2. Create a replication task and select the source objects.
  3. Use schema replication and full replication to initialize the target.
  4. Use incremental replication to keep StarRocks updated after the full load.
  5. Monitor synchronization delay, validate data, and configure alerts.

For detailed version support, permissions, data type mapping, and precheck items, see MySQL to StarRocks.

Before you begin

Prepare the following items:

  • Access to the NineData console.
  • Connection information and accounts for the MySQL source and StarRocks target.
  • Required permissions on both systems.
  • Binlog enabled on the MySQL source when incremental replication is required.
  • Network connectivity from NineData to both systems.

Step 1: Add the source and target data sources

  1. In the NineData console, click Data Source Management > Data Sources, and then click Create Data Source.

    Create a data source in NineData

  2. Follow the page prompts, test the connection, and click Create Data Source.

    Complete data source configuration

  3. Repeat the process for the MySQL source and the StarRocks target.

Step 2: Create the synchronization task

  1. In the NineData console, click Data Replication > Data Replication, and then click Create Replication.

    Create a replication task

  2. Configure the MySQL source and StarRocks target.

  3. Select the replication types required for the task:

    • Schema Replication to create target structures.
    • Full Replication to load existing source data.
    • Incremental Replication to synchronize new source-side changes after the full load.

    Configure MySQL to StarRocks replication

  4. Select the source objects, configure mapping and filtering if needed, and run the precheck.

  5. After the precheck passes, start the task.

  6. Monitor the task until the full load finishes and incremental delay reaches 0 seconds.

    Monitor synchronization delay

Step 3: Validate synchronized data

Use data comparison to confirm that StarRocks contains the expected data.

  1. Open the replication task created in Step 2.

    Open task details

  2. Click the Data Comparison tab. If comparison was not enabled during task creation, click Enable Data Comparison.

    Review data comparison results

  3. Click Re-compare to validate the latest incremental data.

    Run data comparison again

Step 4: Configure alerts

For long-running synchronization tasks, configure alerts for task failure and replication delay.

  1. Open the replication task details page.

    Open task details

  2. Click Configure Alerts.

    Configure task alerts

  3. Enter a Policy Name, review the alert rules, and click Save Configuration.

    Save alert policy

Result

After the task starts, NineData initializes the selected MySQL data in StarRocks and then keeps StarRocks updated through incremental replication. When synchronization delay is 0 seconds and validation passes, the StarRocks target can be used for analytics, reporting, and downstream data warehouse workloads.