Sơn Bùi
08/04/2026, 8:55 AMRocky
08/04/2026, 8:55 AMstarrocks-backup-and-restore) to automate partition-level incremental backups.
* Introducing starrocks-backup-and-restore: Focuses on the "why" behind the tool, discussing state management, metadata tracking, and the "small-file trap" in backups.
*3. Official Documentation & Best Practices*
While not a "blog," the official Back up and restore data documentation contains a "Usage notes" section that functions as a best practices guide, recommending:
* Parallel Loading: During migrations, load data to both the old and new clusters in parallel for a period to verify correctness.
* Load Balancing: Perform backups during off-peak hours as they consume significant cluster resources.
* Schema Consistency: Ensure table schemas match when restoring by overwriting, or use the AS keyword to rename tables during restore to avoid conflicts.
Key Strategies Mentioned:
* Shared-Nothing (Traditional): Uses BACKUP and RESTORE commands to create snapshots of databases/tables in a repository (S3, HDFS, etc.).
* Shared-Data (Modern): Uses Cluster Snapshots for a more automated, low-cost disaster recovery approach that captures the entire system state.
* Incremental Approach: Use external automation to track changed partitions and back up only the deltas to save on storage and network costs.
References
• administration/user_privs/authorization/User_privilege.md
• administration/management/Backup_and_restore.md
• sql-reference/sql-statements/account-management/GRANT.mdSơn Bùi
08/04/2026, 9:00 AMRocky
08/04/2026, 9:01 AMSUBMIT TASK)
StarRocks allows you to schedule SQL statements (like INSERT INTO ... SELECT or CREATE TABLE AS SELECT) to run at specific intervals.
* Syntax: SUBMIT TASK <name> SCHEDULE EVERY (INTERVAL 1 DAY) AS <sql_statement>;
* Minimum Frequency: Controlled by the FE configuration task_min_schedule_interval_s (default is 10 seconds).
* Units: You can use SECOND, MINUTE, HOUR, or DAY.
2. Materialized View Refresh
Asynchronous Materialized Views (MVs) can be set to refresh on a periodic schedule.
* Syntax:
sql
CREATE MATERIALIZED VIEW mv1
REFRESH ASYNC EVERY (INTERVAL 1 HOUR)
AS SELECT ...;
* Minimum Frequency: Controlled by materialized_view_min_refresh_interval (default is 60 seconds). Setting this too low can cause high CPU/memory usage on the FE.
3. Routine Load (Kafka Ingestion)
If you are referring to how often StarRocks consumes data from Kafka:
* Parameter: max_batch_interval inside the PROPERTIES of your CREATE ROUTINE LOAD job.
* Default: 10 seconds.
* Range: 5 to 60 seconds.
* Best Practice: It is generally recommended to keep this at 10 seconds or higher to prevent generating too many small tablet versions (metadata overhead).
4. Automatic Partitioning
When creating tables, you can define a periodic "step" for automatic partition creation.
* Syntax: PARTITION BY RANGE (date_col) (START ("2023-01-01") END ("2024-01-01") EVERY (INTERVAL 1 DAY))
* This defines the "width" or frequency of each partition.
──────────
Which one are you looking for?
If you are looking for Backup/Restore frequency, StarRocks does not have a built-in "cron" for backups yet; most users use an external tool (like a Kubernetes CronJob or starrocks-backup-and-restore CLI) to trigger the BACKUP command periodically (e.g., once every 24 hours).
References
• sql-reference/sql-statements/loading_unloading/routine_load/CREATE_ROUTINE_LOAD.md
• sql-reference/sql-statements/loading_unloading/ETL/SUBMIT_TASK.md
• administration/management/FE_configuration.md
• sql-reference/sql-statements/table_bucket_part_index/CREATE_TABLE.md
References
• sql-reference/sql-statements/loading_unloading/ETL/SUBMIT_TASK.md
• sql-reference/sql-statements/loading_unloading/routine_load/CREATE_ROUTINE_LOAD.md
• sql-reference/sql-statements/table_bucket_part_index/CREATE_TABLE.md
• administration/management/FE_configuration.md
• sql-reference/sql-statements/cbo_stats/CREATE_ANALYZE.mdSơn Bùi
08/04/2026, 9:03 AMRocky
08/04/2026, 9:03 AMBACKUP commands are technically "full" snapshots, but you can achieve an incremental effect by backing up by partition:
* How it works: Instead of backing up the whole table, your script targets only the newest partitions (e.g., PARTITION (p20231027)).
* Benefit: This drastically reduces the backup window and network bandwidth for large fact tables.
* Automation Tooling: The community-developed starrocks-backup-and-restore CLI is specifically designed to automate this. It tracks which partitions have changed and manages the "chain" of full and incremental snapshots for you.
3. Shared-Data vs. Shared-Nothing Strategies
The strategy differs significantly depending on your StarRocks architecture:
* Shared-Nothing (Traditional): You must manually coordinate the BACKUP SNAPSHOT commands to a repository (S3/HDFS).
* Shared-Data (Compute-Storage Separated, v3.5+): Use the Cluster Snapshot feature. This is more automated and captures the entire cluster state (including metadata like users and permissions) to object storage. It is the preferred DR strategy for modern deployments.
4. Operational Best Practices
* Off-Peak Scheduling: Always schedule backups during low-traffic windows (e.g., 2:00 AM) because the snapshot process consumes FE and BE resources.
* Inventory Grouping: Group your tables into categories.
_ _High-Frequency:* Transactional tables (back up daily/hourly).
_ _Low-Frequency:* Reference/Dimension tables (back up weekly).
* Retention Policy: Don't keep snapshots forever. A typical policy is to keep the last 7 daily snapshots and 4 weekly snapshots. You must manually delete old snapshots from your storage (S3/HDFS) as StarRocks does not currently auto-purge them.
* Verification: Periodically test a RESTORE to a separate "staging" cluster to ensure your periodic backups are actually functional.
References
• administration/management/Backup_and_restore.md
• sql-reference/sql-statements/backup_restore/BACKUP.md
• administration/cluster_snapshot.md
• integrations/airflow.md
References
• administration/management/Backup_and_restore.md
• administration/cluster_snapshot.md
• sql-reference/sql-statements/backup_restore/BACKUP.md
• faq/Exporting_faq.md
• integrations/airflow.md