StarRocks
StarRocks is an analytical database for SQL queries, joins, aggregations, and window functions. The application deploys StarRocks 4 in Shared Data mode: table data is stored in Yandex Object Storage, while compute nodes scale independently of storage.
Application components
- Three Frontend (FE) nodes. One FE is placed in each of
ru-central1-a,ru-central1-d, andru-central1-e. FEs accept SQL queries, manage the cluster, and replicate metadata. Two running FEs are required for a quorum. - Compute Nodes (CNs) in a separate instance group with CPU-based autoscaling. CNs execute queries and ingest data; network SSDs store each node’s local data cache.
- A private Object Storage bucket. The
yc_storagestorage volume is created automatically for tables. Bucket object versioning is disabled by default. - An Application Load Balancer in the node placement zones with Web UI and MySQL protocol SQL endpoints.
- Yandex Lockbox secrets for the administrator password and bucket access keys, service accounts, and security groups.
FE and CN nodes use a shared Ubuntu 24.04 LTS image with StarRocks and its dependencies installed. A local agent on each node starts the appropriate component, applies application settings, registers the node with the cluster, and checks readiness.
Default configuration
| Parameter | FE | CN |
|---|---|---|
| Node count | 3 | From 3 to 9, at least 1 per zone |
| vCPUs per node | 8 | 16 |
| RAM per node | 16 GB | 64 GB |
| Separate SSD per node | 100 GB for metadata | 50 GB for cache |
| Boot SSD per node | 50 GB | 50 GB |
The CN autoscaling CPU target is 65%. The default bucket storage class is STANDARD. ALB uses at least 2 resource units per zone, totaling 6. Public Web UI, SQL, and SSH access are disabled.
Configurable settings
- Resources per FE and CN: vCPUs, RAM per vCPU, and separate SSD size. The CN minimum applies per zone; the maximum applies to the entire group.
- Bucket storage class, maximum size, object versioning, and retention of noncurrent versions of table data objects when versioning is enabled.
- Automated cluster snapshots and their interval; disabled by default, with a 10-minute interval.
- FE and CN memory, the query memory pool, the ingestion buffer flush threshold, and the CN disk cache share.
- Per-query memory limit on each CN, query timeout, and spilling intermediate results to disk (
enable_spill). - SQL connections per FE, audit log retention, and the slow query threshold.
- Independent switches for public Web UI, SQL, and SSH access.
- Minimum number of ALB resource units per zone.
Operation
The cluster retains a quorum if one FE fails. Continued operation after losing one zone also depends on Object Storage availability and sufficient capacity on the remaining CNs. Running queries may be interrupted, so SQL clients must support reconnecting and safely retrying queries.
FE metadata resides on separate disks retained during rolling VM updates. Table data is stored in Object Storage; lost CN cache is rebuilt by reading from the bucket. Cluster recovery requires both FE metadata and bucket data.
Under Backups, you can enable automated StarRocks cluster snapshots (Beta). The latest metadata snapshot is saved in the same bucket, and StarRocks cleanup preserves the data files it needs. Snapshots do not protect against loss of the bucket itself; recovery is performed by an administrator. Bucket versioning does not replace a consistent cluster snapshot. A dedicated monitoring system is not included. The Web UI uses HTTP, and SQL TLS is not configured in this build.
Preparation and installation
- Prepare three subnets in one VPC, in
ru-central1-a,ru-central1-d, andru-central1-e. Check quotas for the selected number of VMs, SSDs, public IP addresses, and Application Load Balancer. - In the management console, open the target folder, go to Cloud Apps → Marketplace, select StarRocks, and click Use.
- Enter an application name and select a service account prepared in advance with the roles listed under Deployment permissions below. You can select Auto to have Cloud Apps create a service account with the
adminrole for the folder. See the Cloud Apps installation guide. - Under Network and access, select the three subnets in one VPC that you prepared in step 1 and set the minimum number of ALB resource units per zone. The default is 2 per zone, totaling 6. ALB may increase the number of units as load grows. Leave public endpoints disabled to connect from the VPC or through a VPN, or enable the required protocols. For SSH, select Enabled, provide a username and public key, and enable external access separately if needed.
- Configure FE and CN resources. VM RAM equals the vCPU count multiplied by RAM per vCPU. Choose supported combinations for the
standard-v3platform. The CN maximum is automatically raised to the per-zone minimum multiplied by the number of placement zones if a lower value is entered. For example, with a minimum of 4 CNs per zone and a configured maximum of 3, the effective maximum is4 × 3 = 12CNs. - Configure storage and StarRocks settings. Use
STANDARDfor active analytics. A bucket size limit of 0 means there is no configured cap. In Data storage, bucket object versioning is disabled by default. Select Enabled to set the retention period for noncurrent versions of table data objects. A value of 0 disables automatic deletion of those versions. A positive value sets how many days a version is kept after it becomes noncurrent. Selecting Disabled after versioning was enabled suspends creation of new versions. Existing versions remain in the bucket. A query memory limit of 0 sets no separate limit; overall CN limits still apply. The default query timeout is 300 seconds, and spilling is disabled. - Click Install and wait for installation to finish, with three healthy FEs and the selected minimum CN count in each zone.
Each FE and CN always receives a public IP address for outbound access to Object Storage, Lockbox, and Compute API. The load balancer public IP is also always allocated and remains allocated when public access is disabled. Allocating these addresses does not itself allow incoming connections.
Regional service endpoints
Use service endpoints for the region where the application is deployed. Secrets, the bucket, and VMs must belong to that region.
| Service | Endpoint |
|---|---|
| Object Storage, S3 API | https://storage.yandexcloud.net |
| S3 region | ru-central1 |
| Lockbox secret payload | https://payload.lockbox.api.cloud.yandex.net |
| Compute API | https://compute.api.cloud.yandex.net |
| Internal VM DNS suffix | .ru-central1.internal |
See the API documentation for the complete list of regional service endpoints.
Deployment permissions
If you select an existing deployment service account, assign it the following minimum set of service roles for the application folder in advance. This set assumes that the application, network, and subnets are in the same folder.
| Role | Purpose |
|---|---|
compute.editor |
Create and update instance groups, VMs, and disks. Includes vpc.user for using the network and subnets. |
vpc.publicAdmin |
Allocate the load balancer public IP and public VM addresses. Required even when public access is disabled. |
vpc.securityGroups.admin |
Create and update security groups. |
alb.editor |
Create and update the load balancer, backend groups, and target groups. |
storage.admin |
Create and configure the private bucket, versioning, and lifecycle rules. |
lockbox.admin |
Create secrets and versions, read version payloads, and configure access to secrets. |
iam.serviceAccounts.admin |
Create and use application service accounts, and manage their static access key and access permissions. Includes iam.serviceAccounts.user permissions. |
resource-manager.admin |
Assign folder roles to service accounts and configure bucket IAM access. |
The application assigns roles to the node and Instance Groups service accounts automatically. Keep these permissions on the deployment account for application updates and deletion. If the network or subnets are in another folder, additionally grant the necessary network permissions in their folder to both the deployment account and the Instance Groups account created by the template.
Connecting
Open the installation outputs. Follow the Administrator password link to Lockbox and retrieve the password entry. Reading the secret payload requires lockbox.payloadViewer or another role that includes this permission.
| Connection | From the VPC or through a VPN | From the internet, when allowed |
|---|---|---|
| Web UI | HTTP, ALB port 18030 | HTTP, ALB port 8030 |
| SQL, MySQL protocol | ALB port 19030 | ALB port 9030 |
| SSH, when enabled | Private VM IP, port 22 | Public VM IP, port 22 |
For the Web UI, use the StarRocks console login link, username root, and the Lockbox password. For SQL, copy the command from SQL connection. For example, from the private network:
mysql -h <ALB_PRIVATE_IP> -P 19030 -u root -p
Enter the password when prompted. TLS is not configured for the Web UI or SQL in this build. The Web UI uses HTTP Basic authentication: the username and password are transmitted without encryption. Lockbox protects the stored secret but does not encrypt the connection to the Web UI. For secure access, use a VPN and the private ALB address; the public HTTP endpoint transmits credentials in cleartext. After initial setup, create separate SQL users with the permissions your applications require.
Checking readiness
Run these commands in your SQL client:
SELECT VERSION();
SHOW FRONTENDS;
SHOW COMPUTE NODES;
There should be three FEs with Alive = true and Join = true, including one LEADER. CNs should have Alive = true, with at least the configured count in each zone. Then create the demo table and run the query from the examples section.
Loading data
Use INSERT for small datasets. For bulk ingestion, use Stream Load or other methods described in the StarRocks documentation. Stream Load can redirect an HTTP request from an FE to a CN: the client needs direct access to private FE addresses on port 8030 and CN addresses on port 8040. The public SQL endpoint alone is insufficient for this loading method.
Changing settings and updating
Change parameters through Cloud App settings and check that all nodes are healthy before updating. Changes are applied during rolling VM updates; each group allows one unavailable node. Separate FE and CN disks are retained when replacing a boot disk without scaling the group down. Local logs on a replaced boot disk are not retained.
Changing the SSH username or public key requires rolling replacement of VM boot disks: updating VM metadata does not rewrite authorized_keys.
The query_mem_limit, query_timeout, and enable_spill parameters set defaults for new SQL sessions. Existing connections retain their values, and clients can override them with SET. The agent maintains the global defaults configured in the application form.
Stop long-running analytics during planned updates. If a connection breaks, clients must reconnect to the ALB and restore their session settings. Read queries can be retried; retrying writes requires duplicate protection.
Changing an FE’s availability zone and hostname requires a separate migration with a new subnet and metadata transfer: the metadata disk is tied to its zone.
Keep the CN group size constant during image updates and do not change its minimum. The template does not pause autoscaling; scale-in deletes the disks and local configuration of the removed CNs.
Existing disks can only grow; the agent automatically expands ext4 on the node’s next startup. Moving to another StarRocks version requires a separate compatibility check and CN/FE upgrade procedure. Changing a Lockbox secret alone does not change the installed SQL password or credentials of the existing storage volume.
Data protection and deletion
Under Backups, enable Automated cluster snapshots and set an interval from 1 to 10080 minutes (7 days); the default is 10 minutes. The FE leader applies the setting during application updates. Changing the interval preserves the current snapshot; disabling snapshots deletes it. Only the latest snapshot is retained, rather than a backup history. This is a Beta feature; snapshot creation may take additional time.
Check the settings and results through SQL:
ADMIN SHOW AUTOMATED CLUSTER SNAPSHOT;
SELECT * FROM information_schema.cluster_snapshots;
SELECT * FROM information_schema.cluster_snapshot_jobs;
Snapshots use yc_storage and the same bucket as table data. Bucket object versioning and automated cluster snapshots are configured separately. Protection against loss of the bucket requires a separate copy of the snapshot metadata and related data. Recovery is performed by an administrator following the StarRocks instructions; the application does not restore snapshots automatically. Set up monitoring separately. Before deleting the application, preserve any data you need and empty the bucket. If versioning was ever enabled, also remove all object versions and delete markers.
- Store analytics: revenue by seller and category, order trends, and customer activity.
- Interactive reports and BI dashboards joining multiple tables.
- Analysis of events, product metrics, and application logs.
- Processing growing datasets with independently scaled CNs.
Your first SQL query
Create an orders table in a new demo database and load a few rows. The application has already configured yc_storage; you do not need to pass Object Storage access keys in SQL.
CREATE DATABASE marketplace_demo;
USE marketplace_demo;
CREATE TABLE orders (
order_id BIGINT NOT NULL,
seller_id BIGINT NOT NULL,
order_date DATE NOT NULL,
amount DECIMAL(14, 2) NOT NULL
) ENGINE = OLAP
DUPLICATE KEY(order_id)
DISTRIBUTED BY HASH(order_id) BUCKETS 6
PROPERTIES ("storage_volume" = "yc_storage");
INSERT INTO orders VALUES
(1, 101, '2026-10-01', 1500.00),
(2, 102, '2026-10-01', 2400.00),
(3, 101, '2026-10-02', 800.00);
SELECT seller_id,
COUNT(*) AS orders_count,
SUM(amount) AS revenue
FROM orders
GROUP BY seller_id
ORDER BY revenue DESC;
Expected results: seller 102 has one order totaling 2400.00; seller 101 has two orders totaling 2300.00. This example creates a database and retains its data; loading the rows again into this DUPLICATE KEY table adds them again.
Yandex Cloud technical support responds to requests 24/7. The types of requests available and their response time depend on your pricing plan. You can activate paid support in the management console. Learn more about requesting technical support in the documentation.
| Resource type | Quantity |
|---|---|
| VPC IP address | 1 |
| VPC security groups | 2 |
| Service accounts | 2 |
| Access rights for service account | 1 |
| Service account static access key | 1 |
| Access rights for folder | 5 |
| Object Storage bucket | 1 |
| Access binding for Object Storage bucket | 1 |
| Lockbox secrets | 2 |
| Lockbox secret versions | 2 |
| Access bindings for Lockbox secret | 2 |
| Instance groups | 2 |
| ALB backend groups | 2 |
| ALB L7 Application Load Balancer | 1 |