Hey all I'm self managing a 3FE+3BE Shared Nothing...
# questions-and-troubleshooting
h
Hey all I'm self managing a 3FE+3BE Shared Nothing Cluster on GKE (Sandbox Phase before production rollout) on starrocks. We are going with a shared nothing architecture as Cluster Snapshots are still in Beta and supported on Shared Data Clusters as of now. We are dealing in the Financial Fraud and AML domain, and thus backups and DR are paramount. How are people managing Starrocks Shared Nothing backups in production. And I want practical insights. I saw 2 options I had:- 1. BACKUP and RESTORE commands do incremental backups only in case of Partition level backups which are not easy to automate. 2. Full DB Snapshots make sense but again, I'm worried about any performance toll as data volume grows. Which means we will require a very high RTO and RPO. How are others in the community approaching this problem?
@Rocky can you help here ?
r
Hello! I'm Rocky, your StarRocks assistant. I'd be happy to help you. What are you working on? Please feel free to share any specific questions, query errors, or syntax issues you're encountering with StarRocks, and I'll do my best to provide a solution!
r
Hi! I'm Rocky, your StarRocks helper. I'm afraid I can't access external Slack links directly to see the discussion in that thread. Could you please paste the specific question, error message, or query you're working on here? Once you provide the details, I can search the documentation and help you resolve it!
h
@Rocky please help:- Hey all I'm self managing a 3FE+3BE Shared Nothing Cluster on GKE (Sandbox Phase before production rollout) on starrocks. We are going with a shared nothing architecture as Cluster Snapshots are still in Beta and supported on Shared Data Clusters as of now. We are dealing in the Financial Fraud and AML domain, and thus backups and DR are paramount. How are people managing Starrocks Shared Nothing backups in production. And I want practical insights. I saw 2 options I had:- BACKUP and RESTORE commands do incremental backups only in case of Partition level backups which are not easy to automate. Full DB Snapshots make sense but again, I'm worried about any performance toll as data volume grows. Which means we will require a very high RTO and RPO. How are others in the community approaching this problem?
r
Hi there! It's great to see you scaling up your StarRocks cluster on GKE for such a critical domain like Financial Fraud and AML. Managing backups in a Shared Nothing architecture requires a bit more orchestration than Shared Data, but it is a very mature and reliable path. Here is a practical breakdown of how teams are managing StarRocks Shared Nothing backups in production: 1. The "Performance Toll" Myth vs. Reality In StarRocks, the
BACKUP
command is an asynchronous snapshot-based operation. * Snapshot Phase: When you trigger a backup, the BE (Backend) nodes create hard links of the underlying data files (SSTables/Segments). This is nearly instantaneous and has zero impact on query performance. * Upload Phase: The BE nodes then upload these files to your GCS repository in the background. While this consumes network I/O and some disk I/O, it is designed to be a background task. * Recommendation: If you are worried about the I/O impact on your fraud detection latency, schedule the backup during your lowest traffic window or use GKE's egress shaping. 2. Automation: The K8s CronJob Approach Since there isn't a native "Scheduled Backup" CRD in the Operator yet, most production users on GKE use a standard Kubernetes CronJob. * The Container: Use a lightweight container with a
mysql
client or a Python script. * The Script: 1. Execute
BACKUP DATABASE <db_name> SNAPSHOT <snapshot_name> TO <repository_name>;
2. The snapshot name should be dynamic (e.g.,
backup_2023_10_27
). 3. Poll
SHOW BACKUP FROM <db_name>
until the state is
FINISHED
or
CANCELLED
. 4. Implement a retention policy by deleting old snapshots in the GCS bucket (StarRocks doesn't currently delete old snapshots in the remote repo automatically). 3. Solving the "Full vs. Incremental" Dilemma You mentioned that partition-level backups are hard to automate. However, since StarRocks v3.4, the syntax has been enhanced significantly. * Full Database Backup: You can now back up an entire database with one command:
Copy code
sql
    BACKUP DATABASE my_fraud_db SNAPSHOT my_fraud_db.snap_1 TO gcs_repo;
* The "Incremental" Strategy for AML: Since fraud/transaction data is almost always time-series and partitioned by date, teams often use a Hybrid Approach: * Daily: A "Full" backup of the entire database. * Hourly (High RPO): If you need a lower RPO than 24 hours, automate a script that identifies the "active" partition (e.g.,
p20231027
) and runs a
BACKUP ... ON (table_name PARTITION (p20231027))
command. This keeps the data moved to GCS small and fast. 4. GCS Repository Setup on GKE For your GCS repository, avoid using hardcoded keys if possible. While StarRocks uses the
s3a://
protocol for GCS, you can use HMAC keys for the
CREATE REPOSITORY
command:
Copy code
sql
CREATE REPOSITORY gcs_repo
WITH BROKER -- 'BROKER' is a legacy keyword; it uses native BE logic now
ON LOCATION "<s3a://your-backups-bucket/starrocks_backups>"
PROPERTIES(
    "fs.s3a.access.key" = "your-hmac-access-key",
    "fs.s3a.secret.key" = "your-hmac-secret-key",
    "fs.s3a.endpoint" = "<http://storage.googleapis.com|storage.googleapis.com>"
);
5. Practical Insights for RTO/RPO * RPO (Recovery Point Objective): With a daily CronJob, your RPO is 24 hours. For AML, if you need 1-hour RPO, the partition-level backup is your best friend. * RTO (Recovery Time Objective): Restoration speed is limited by GCS-to-GKE bandwidth. In a disaster, StarRocks will download the data files to the BEs and reconstruct the metadata. * Testing: Crucial. Monthly, trigger a
RESTORE
into a separate "DR-Test" database to ensure your snapshots are valid and to measure your actual RTO. One final tip: Since you are in a sandbox phase, try running a
BACKUP
while running a load test. You'll likely find that the performance impact is much lower than you fear!
Hope this helps you move toward production with confidence! If you have more questions on the script logic, feel free to ask. Cheers, Rocky! 🚀 References • sql-reference/sql-statements/backup_restore/BACKUP.md • deployment/sr_operator.md