<@U0A71G31CDV> - we went through an AWS AZ outage ...
# questions-and-troubleshooting
v
@Rocky - we went through an AWS AZ outage recently and it forced us to evaluate two HA approaches for our shared-nothing setup: Option A: Multi-AZ active replication - spread BEs across AZs, replication_num=3, survive an AZ loss with zero RTO but ~30% cross-AZ data transfer overhead Option B: Fresh cluster restore from backups - single-AZ, lower cost, but RTO depends on how fast you can restore FE meta + data from S3 A few questions on the tradeoffs: 1. In practice, what's the real RTO for Option B? Between restoring FE meta, re-registering BEs, and running RESTORE for critical tables - are we talking 30 mins, 2 hours, 4 hours? 2. For Option A - at petabyte scale, does the 30% cross-AZ replication overhead stay roughly linear or does it spike during compaction/rebalancing? 3. Has anyone run CCR as a middle ground - primary in one AZ, standby in another, failover in minutes without paying full multi-AZ replication costs on every write?
r
Based on StarRocks documentation and operational best practices, here is a breakdown of the tradeoffs for your shared-nothing high-availability (HA) strategies: 1. Option B: Real-world RTO for Backup/Restore For a Shared-nothing setup, RTO is split into two phases: Metadata Recovery and Data Restoration. * FE Metadata + BE Registration: This is very fast. Restoring the FE metadata (via checkpoint files) and re-registering BEs typically takes 5–15 minutes. * Data Restore (The Bottleneck): The
RESTORE
command pulls data from S3 to BE local disks. Performance is highly parallel across all BE nodes. * Concurrency: Performance is tuned via
download_worker_count
(default is number of CPU cores) and
download_buffer_size
. * Throughput: In high-concurrency scenarios, StarRocks can achieve restore speeds of ~1-2 TB per hour per node depending on S3 bandwidth and disk I/O. * Scale: For a petabyte-scale cluster, RTO is determined by the "densest" node. If your BEs hold 10TB each, you are likely looking at 4–8 hours for a full restore. If you only restore "critical tables" first, you can achieve a "Partial RTO" of 30–60 minutes. 2. Option A: Cross-AZ Overhead at Petabyte Scale The ~30% overhead is largely driven by cross-AZ data transfer costs and write latency (synchronous write quorum). * Linearity of Ingest: Cross-AZ traffic for ingestion is linear. Every 1GB loaded into the Coordinator BE results in ~2GB of cross-AZ traffic (to replicate to the other 2 AZs). * Compaction (Local): In Shared-nothing, compaction is local to each BE. Each replica performs its own compaction independently on its own local disk. Therefore, compaction does not spike cross-AZ traffic. * Rebalancing/Repair (Spiky): This is where costs spike. If a node fails or you scale out, StarRocks will "clone" replicas across AZs to maintain
replication_num=3
. At PB scale, a single node failure can trigger TBs of cross-AZ movement, which is both expensive and bandwidth-intensive. 3. CCR (Cross-Cluster Replication) as a Middle Ground CCR is often used for Disaster Recovery (DR) rather than HA, but it can serve as a middle ground: * Mechanism: It is asynchronous replication between a primary and standby cluster. * Cost Savings: * Write Latency: Unlike Option A, the primary cluster doesn't wait for the remote AZ to acknowledge writes, so there is zero latency impact on ingestion. * Compute Elasticity: You can technically run a smaller standby cluster (fewer nodes) to save costs, provided it can handle the replication stream. You only scale it up to full capacity during a failover. * RTO: Typically minutes. Failover involves promoting the standby cluster to "primary" status (making it writable) and updating your application's connection string (or Load Balancer). * Tradeoff: Since it's asynchronous, there is a non-zero RPO (Recovery Point Objective). You might lose a few seconds of data during an AZ outage. Summary Table Feature | Option A (Multi-AZ) | Option B (Restore) | CCR (Standby) RTO | Near-Zero | Hours (4h+) | Minutes (5-10m) RPO | 0 | 24h (or last backup) | Seconds Cross-AZ Cost | High (Sync writes) | Low (Only on failure) | Moderate (Async writes) Operational Effort | Low (Auto) | High (Manual/Scripted) | Moderate (Failover prep) Recommendation: If you can tolerate a few seconds of data loss, CCR provides the best balance. It avoids the sync-write latency of Multi-AZ while keeping RTO significantly lower than a full S3 restore. Referencesadministration/management/resource_management/Replica.mddeployment/shared_data/azure.md
v
@Rocky is there a best practices guide, can you link the related documentation and user stories
r
For your shared-nothing setup, the choice between Multi-AZ, Backup/Restore, and Cross-Cluster Replication (CCR) depends on your specific RTO/RPO requirements. Below are the related documentation links and best practices gathered from official sources and production user stories. 1. Best Practices & Documentation Links * Disaster Recovery (Shared-Nothing): Backup and Restore Guide * Best Practice: Do not use
replication_num=1
. Always use
3
for production. * Performance Tuning: Modify
download_worker_count
in
be.conf
to maximize S3-to-disk throughput during restoration. * Disaster Recovery (Shared-Data/Cloud-Native): Cluster Snapshot Guide * Note: If you move to shared-data (compute-storage separated) in v3.4.2+, StarRocks supports "Cluster Snapshots" which allow minutes-level RTO because only metadata is restored; the data remains in S3 and is immediately accessible by the new CN nodes. * Middle Ground: Cross-cluster Data Migration Tool (Cluster Sync) * This is the StarRocks equivalent of "CCR." It uses a tool called starrocks-cluster-sync which leverages the StarRocks Binlog (v3.0+) to asynchronously replicate data between a primary and standby cluster. * RTO: Minutes (switching application traffic). * RPO: Seconds (latency of the binlog stream). * AWS HA Architecture: StarRocks AWS Quick Start * Provides a CloudFormation/Terraform template for a Multi-AZ deployment following AWS best practices (Public/Private subnets, NAT Gateways, FE/BE distribution). 2. User Stories and Implementation Patterns * E-Commerce & FinTech (Multi-AZ Active): * Production users (e.g., cases documented by engineers at Tencent and Airbnb) typically deploy a 3-FE, Multi-BE cluster spread across 3 AZs. * Insight: To mitigate the 30% cross-AZ cost, users often optimize local read affinity. While writes are cross-AZ, reads can be directed to local replicas where possible. * Compaction: Users have found that while writes are linear, compaction is local to the BE. Therefore, background maintenance doesn't significantly add to the cross-AZ "transfer tax." * Large Scale DR (Active-Passive with Cluster Sync): * A common pattern for PB-scale users who cannot afford 3x storage/transfer costs is to maintain a Primary cluster in one AZ and a Standby cluster with reduced compute power in another. * They use the starrocks-cluster-sync tool to keep the standby warm. In a disaster, they scale up the standby cluster nodes and point their BI tools to the new FE. * Incremental Tooling: * Third-party tools like
starrocks-backup-and-restore
(by Deep.BI) are used by teams to handle incremental backups to S3, reducing the daily load on the cluster compared to full snapshots. Summary of Tradeoffs for your Scale Strategy | Recommended Link | RTO / RPO | Scale Considerations Multi-AZ | [Manage Replica](https://docs.starrocks.io/docs/administration/management/resource_management/Replica/) | 0 / 0 | Linear write cost; repair/balance causes spikes. Backup/Restore | [RESTORE SQL Reference](https://docs.starrocks.io/docs/sql-reference/sql-statements/backup_restore/RESTORE/) | 4h+ / 24h | PB-scale restore is limited by S3-to-BE disk I/O. CCR (Sync Tool) | [Migration Tooling](https://docs.starrocks.io/docs/administration/data_migration_tool/) | Mins / Secs | Best cost/performance balance for DR.
Pro-Tip: If your setup is strictly shared-nothing and you are worried about RTO, evaluate the v3.0+ Binlog feature. Enabling binlogs on your critical tables allows you to use the
cluster-sync
tool, giving you that "middle ground" you mentioned without the full Multi-AZ sync overhead. Referencesknowledge/usage/best-practice.mdadministration/cluster_snapshot.mdadministration/management/resource_management/Replica.mddeployment/shared_data/azure.mdbest_practices/partitioning.md