<@U0A71G31CDV> how many storage volumes can starro...
# questions-and-troubleshooting
g
@Rocky how many storage volumes can starrocks handle? I want to have 1 storage volume per DB./
r
In StarRocks (shared-data mode), the answer depends on the storage type you are using. Storage Volume Limits * Object Storage (S3, Azure Blob, GCS): There is no hard limit on the number of object storage volumes you can create. You can technically have one storage volume per database by assigning the
storage_volume
property at the database level. * HDFS: You are restricted to only one HDFS storage volume per StarRocks instance. Creating multiple HDFS volumes can lead to "unknown behaviors" and is not supported. Implementation: 1 Volume per Database If you are using object storage, you can achieve your goal using the following steps: 1. Create the storage volume:
Copy code
sql
    CREATE STORAGE VOLUME db1_volume
    TYPE = S3
    LOCATIONS = ("<s3://my-bucket/db1_data/>")
    PROPERTIES ("aws.s3.region" = "us-east-1", ...);
2. Assign it to the database:
Copy code
sql
    CREATE DATABASE db1 PROPERTIES ("storage_volume" = "db1_volume");
Note: All tables created in this database will inherit this storage volume by default. Best Practices & Considerations While you can create a volume for every database, consider whether you truly need distinct Storage Volume objects: * When to use multiple volumes: Use multiple volumes if each database requires different credentials (IAM roles/keys), different endpoints, or different buckets for physical isolation. * Metadata Overhead: While volumes are lightweight, every unique volume adds metadata that the Frontend (FE) must track. If you have thousands of databases, managing thousands of volumes might increase management complexity without significant benefit. * Path Isolation: If your goal is simply to keep data in different folders (e.g.,
<s3://bucket/db1/>
vs `s3://bucket/db2/`), you can often use a single storage volume pointed at the bucket root and let StarRocks manage the internal directory structure, or specify different
storage_volume
targets if they point to different sub-paths. Summary: If you're on S3/Object storage, your plan is feasible. If you're on HDFS, you must stick to one volume for the entire cluster. Referencessql-reference/sql-statements/cluster-management/storage_volume/CREATE_STORAGE_VOLUME.md