<@U0A71G31CDV> What does the `replication_num` do ...
# questions-and-troubleshooting
d
@Rocky What does the
replication_num
do in a shared data cluster when creating a table?
r
In a StarRocks shared-data cluster (compute-storage separation), the behavior of the
replication_num
property depends on the type of table you are creating: 1. Cloud-native Tables For cloud-native tables (tables created in a shared-data cluster that store data in remote object storage like S3 or HDFS), the
replication_num
property is effectively 1. * Storage Durability: Physical data durability is provided by the backend object storage (e.g., S3's 99.999999999% durability). StarRocks does not need to maintain multiple physical copies of the data files on the remote storage. * Logic: Since data is shared across all compute nodes (CNs) via the shared storage volume, StarRocks only maintains one "logical" replica for metadata management and task scheduling purposes. * Constraint: You typically do not need to specify
replication_num
for cloud-native tables. If you do, it should be set to 1. Setting it to a higher value in many StarRocks versions is either ignored or not supported for these table types because the redundancy is handled by the storage layer. 2. Traditional (Shared-nothing) Tables on a Shared-data Cluster If you are creating a "local" table (one that uses the internal storage engine of the BE nodes rather than the shared cloud storage), the
replication_num
works as it does in a shared-nothing cluster: * It determines the number of data copies stored across different BE nodes. * The default is 3, requiring at least 3 BE nodes for high availability. _ _Note: Using local tables in a shared-data cluster is rare as it defeats the purpose of storage-compute separation.* Summary of Properties for Shared-data Tables When creating a table in a shared-data cluster, you usually focus on these properties instead: *
storage_volume
: Specifies which remote storage (S3, GCS, HDFS, etc.) to use. *
datacache.enable
: Controls whether to cache data on the local disks of the CN/BE nodes for query acceleration (defaults to
true
). *
datacache.partition_duration
: Sets the TTL for hot data in the local cache. Recommendation: For cloud-native tables in a shared-data environment, omit the
replication_num
property or set it to
1
. Focus instead on configuring your Storage Volume and Data Cache settings to optimize performance and cost. References • administration/management/resource_management/Replica.md • faq/shared_data_faq.md • deployment/shared_data/azure.md • sql-reference/sql-statements/table_bucket_part_index/CREATE_TABLE.md • deployment/shared_data/s3.md • faq/Sql_faq.md • deployment/shared_data/gcs.md