Max Kemel
08/26/2026, 12:24 PMRocky
08/26/2026, 12:24 PMVARIANT columns from Iceberg tables stored in Parquet format. It provides a suite of functions (e.g., get_variant_int, variant_query, variant_typeof) to extract and navigate nested semi-structured data.
* Write Support: You can write VARIANT data to Iceberg tables. StarRocks supports casting JSON strings or complex SQL types (ARRAY, MAP, STRUCT) into VARIANT for sinking into Iceberg.
* Vectorized Execution: v4.1 integrates the Iceberg Variant format directly into its vectorized execution engine. This allows the engine to perform field extraction and filtering on the binary-encoded data without expensive JSON parsing at runtime.
2. Known Limitations (Current Version)
While functional, there are several limitations that impact production design:
* Unshredded Only: Currently, StarRocks only supports unshredded variant values for both read and write. If your existing Iceberg data is stored using "shredded" Parquet columns (a performance optimization in the Parquet Variant spec), StarRocks may only be able to access the fallback unshredded binary.
* 16 MB Size Limit: Individual VARIANT values are limited to 16 MB.
* Catalog Specific: The VARIANT type is only supported in the Iceberg Catalog. It is not yet supported for StarRocks native (Internal) tables.
* Parquet Only: Support is restricted to Iceberg tables using the Parquet file format with variant encoding.
3. Production Maturity & Risks
* New Feature: Since this was introduced in v4.1, it has not yet undergone years of battle-testing in diverse production environments compared to standard types.
* Bugs: There are no widely reported "showstopper" bugs as of the latest release notes, but the "unshredded only" limitation is the most likely source of interoperability issues with other engines (like Spark 4.0+) that might default to shredded writes.
* Recommendation: For production, it is suitable for "Schema-on-Read" workloads where you need to avoid rigid DDL changes, provided your individual records stay under 16MB and you are using StarRocks v4.1+. If performance for specific nested fields is critical, consider that the lack of "shredding" support means StarRocks still has to read the full variant binary for extraction, though it is still faster than raw JSON strings.
Relevant Documentation Reference:
* StarRocks v4.1 VARIANT Data Type
References
• data_source/catalog/iceberg/iceberg_catalog.md
• data_source/feature-support-data-lake-analytics.md
• quick_start/iceberg.md
• sql-reference/data-types/semi_structured/VARIANT.mdMax Kemel
08/26/2026, 12:32 PMRocky
08/26/2026, 12:32 PMSTRUCT for shredded fields because the engine reads the extracted sub-column directly.
NON-SHREDDED VARIANT | ~3x - 10x Slower | Better than text because it uses a binary format (offset-based navigation), but the engine must still load the full 10KB blob for every row to find the field.
TEXT (JSON STRING) | ~20x - 50x Slower | Worst performance. Every row requires full text parsing (lexing/regex) to find a single field, which is extremely CPU-intensive for 10KB records.
──────────
3. Known Issues & Production Readiness
* Interoperability: If you write data from StarRocks v4.1, it will be unshredded. If you use other engines (like Spark 4.0+ or Snowflake) to read this, they will fall back to binary navigation, losing their "shredding" speed advantage.
* Internal Table Support: The VARIANT type currently only works for Iceberg Catalog. If you need semi-structured data in StarRocks' native storage, you must use the JSON type with Flat JSON enabled (which provides shredding-like performance automatically).
* Size Limit: Individual Variant values are capped at 16MB.
* Production Verdict:
* Suitable for: Log analytics, event streams, and "Schema-on-Read" where flexibility is more important than absolute peak performance.
* Avoid for: High-concurrency, low-latency "point lookups" or massive aggregations on a single nested field (use STRUCT or StarRocks native tables with Flat JSON for that).
Authoritative Source: StarRocks v4.1 VARIANT Documentation
References
• sql-reference/data-types/semi_structured/VARIANT.md
• using_starrocks/Flat_json.md
• sql-reference/data-types/semi_structured/JSON.mdEliezer Talker
08/26/2026, 12:58 PMRocky
08/26/2026, 12:58 PMJSON type)
For native StarRocks tables using the JSON data type, you primarily use Arrow Notation:
* Arrow Notation (->): json_col -> '$.path.to.field' or json_col -> 'field'.
* Arrow Notation with Type Casting: You can chain arrows or use functions like get_json_string(json_col, '$.path').
* Dot Notation: Not supported for the JSON type; it is reserved for STRUCT.
2. Iceberg External Table (STRUCT type)
For Iceberg tables where the schema is explicitly defined as a STRUCT, StarRocks uses standard SQL Dot Notation:
* Dot Notation (.): struct_col.field_name or struct_col.nested_struct.field.
* Example: SELECT user_profile.name FROM iceberg_catalog.db.users;
* Arrow Notation: Not supported for STRUCT.
3. Iceberg External Table (VARIANT type)
The VARIANT type (introduced in v4.1) is a binary-encoded semi-structured type. Currently, it relies on Functional Access rather than operators:
* Functions: variant_query(variant_col, '$.path') (returns another Variant) or get_variant_int(variant_col, '$.path') (returns a specific type).
* Unified Access Strategy: To use Arrow notation on Iceberg VARIANT data, you must cast it to JSON first:
sql
-- Casting to JSON to use Arrow Notation
SELECT CAST(variant_col AS JSON) -> '$.user.id'
FROM iceberg_catalog.db.table;
Summary Table for Federated Queries
If you are writing a query that joins a native StarRocks table (JSON) and an Iceberg table (STRUCT/VARIANT), here is the syntax you will use:
Source/Type | Syntax | Example
Internal (JSON) | Arrow (->) | json_col->'key'
Iceberg (STRUCT) | Dot (.) | struct_col.key
Iceberg (VARIANT) | Functions | variant_query(v_col, '$.key')
Pro-Tip: Making it "Look" the Same
If you want a unified "dot notation" experience for your end-users across both systems, you can create Views.
1. For StarRocks JSON columns, create a view that extracts fields into virtual columns.
2. For Iceberg VARIANT columns, create a view that casts them to STRUCT (if the schema is somewhat stable) or extracts fields via functions.
Production Note: Using CAST(variant_col AS JSON) allows the use of Arrow notation but may incur a small parsing overhead compared to using the specialized get_variant_* functions which are optimized for the binary Variant format.
References
• sql-reference/data-types/semi_structured/VARIANT.md
• sql-reference/sql-functions/json-functions/json-query-and-processing-functions/arrow-function.md
• sql-reference/data-types/semi_structured/STRUCT.md
References
• sql-reference/data-types/semi_structured/VARIANT.md
• sql-reference/sql-functions/json-functions/json-query-and-processing-functions/arrow-function.md
• sql-reference/sql-functions/json-functions/overview-of-json-functions-and-operators.mdMax Kemel
08/26/2026, 1:42 PMRocky
08/26/2026, 1:43 PMstorage_cooldown_time or storage_cooldown_second at the partition or table level.
* Maturity: Highly Stable. This is the standard for users who want to manage their own hardware but offload historical data to cheaper storage.
* Production Suitability: Excellent for on-premises or fixed-size clusters.
* Known Limitation: Scaling out requires rebalancing data across BEs, which can be time-consuming for very large datasets.
Mode 2: Cloud-Native Shared-Data (Architecture of Choice)
Introduced in v3.0 and significantly hardened in v3.1+, this is the modern architecture of StarRocks. Most new large-scale cloud deployments (AWS/GCP/Azure) use this mode.
* How it works: StarRocks writes data directly to S3. The local SSD on the Compute Nodes (CN) acts as a transparent cache. You control "hot" data using datacache.partition_retention_days or by cache size.
* Maturity: Production Ready. It is the primary architecture for StarRocks' own managed cloud service and is used by many Fortune 500 companies for petabyte-scale analytics.
* Production Suitability: Best for cloud environments where you need to scale compute (CNs) up and down instantly without moving data.
* Known Limitation:
* As of current versions, it does not support the native BACKUP and RESTORE commands (you typically rely on S3's native versioning/replication).
* Querying "cold" data (data not in cache) will have higher latency as it must be pulled from S3.
Comparison for Your Use Case
Feature | Mode 1 (Shared-Nothing) | Mode 2 (Shared-Data)
Storage Format | StarRocks Native (Segment) | StarRocks Native (Segment)
Stability | Mature (Years in Prod) | Stable (Proven since v3.1)
Hot/Cold Logic | Time-based movement (SSD -> S3) | LRU Cache-based (Hot on SSD)
Scaling | Slow (requires data rebalance) | Instant (Stateless compute)
Reliability | Multi-replica on local disks | S3 durability (11 nines)
Recommendation
* Choose Mode 2 (Cloud-Native) if you are on AWS/GCS/Azure. It is much easier to manage, cheaper (no need for 3x local replication), and the cache is very efficient. Set your cache size to fit about 7 days of data, and StarRocks handles the rest.
* Choose Mode 1 (Shared-Nothing) only if you are On-Premises or have extremely strict latency requirements that cannot tolerate even occasional S3 "cold" reads.
Production Tip: If you choose Mode 2, ensure your CN nodes have high-performance Local NVMe SSDs for the cache. This ensures that the "hot" 7 days of data perform exactly like local storage.
References
• introduction/Architecture.md
• deployment/shared_data/feature-support-shared-data.md
• deployment/shared_data/s3.md
• table_design/table_design.md
• administration/management/FE_configuration.md
References
• introduction/Architecture.md
• deployment/shared_data/feature-support-shared-data.mdMax Kemel
08/26/2026, 1:48 PMRocky
08/26/2026, 1:48 PMdatacache.enable is set to true (the default), the data is written simultaneously to both S3 and the local SSD cache.
* The Flow: Compute Node (CN) receives data → Writes to Local SSD AND starts uploading to S3 → Waits for S3 to confirm receipt → Returns "Success" to the user.
* Result: Data is immediately durable in S3 and immediately "hot" in your local cache for the next query.
2. Asynchronous Write (High Performance)
StarRocks supports an "Async Write-back" mode (often enabled via enable_shared_storage_async_write in newer versions or seen as "Asynchronous data ingestion" in docs) to hide S3 latency.
* The Flow: CN receives data → Writes to Local SSD cache → Immediately returns "Success" to the user → Background thread uploads the data to S3.
* Result: Much faster ingestion because the user doesn't wait for S3 network latency.
* Risk: If a CN node physically dies before the background upload completes, the data from that specific un-uploaded batch could be lost (similar to how local disk buffers work).
What about the 7-day TTL?
The datacache.partition_duration (e.g., 7 DAY) does not control when data moves to S3. It controls the cache eviction priority:
* Initial Write: All data is written to S3 immediately (or shortly after with async write).
* Cache Logic: The data stays on your local SSD as a cache. If the SSD gets full, StarRocks uses an LRU (Least Recently Used) policy to clear space.
* The TTL Rule: If you set a 7-day duration, StarRocks will keep data younger than 7 days "hot." If that data is evicted due to space, and you query it again, StarRocks will automatically pull it back from S3. If data is older than 7 days and gets evicted, StarRocks will generally not prioritize re-caching it unless configured otherwise.
Summary
* Is it written to S3 first? In default mode, it's simultaneous. In async mode, it's local first, then S3 (usually within seconds).
* Does it wait for TTL to expire? No. Data is sent to S3 as part of the ingestion process. The TTL only manages how long that data "clings" to your local SSD for speed.
References
• deployment/shared_data/s3.md
• administration/management/BE_configuration.md
• introduction/Architecture.md
• deployment/shared_data/azure.md
• using_starrocks/caching/block_cache.md
References
• deployment/shared_data/s3.md
• knowledge/usage/load/shared_data_batch_ingestion.mdMax Kemel
08/26/2026, 1:51 PMRocky
08/26/2026, 1:51 PMMax Kemel
08/26/2026, 1:54 PMRocky
08/26/2026, 1:54 PMBACKUP / RESTORE SQL) | Not supported (You must use S3-level replication/snapshots)
Inverted Index | Fully supported (v3.0+) | Limited support (Being added in recent v3.3.x+ versions)
Data Rebalance | Required (moves physical data) | Not required (CNs are stateless; scaling is instant)
Table Types | All supported | Primary Key, Duplicate, Aggregate (All major types supported)
Storage Usage | Precise | Can appear inflated on S3 due to historical versions/lagging vacuum
3. Common "Friction Points" (Not necessarily bugs, but operational challenges)
In Cloud-Native Mode:
* Compaction Staleness: Since compaction is coordinated by the FE and executed by CNs, tasks can sometimes get "stuck" if a CN node is restarted frequently or if resources are tight. This can lead to a build-up of small files on S3.
* Cache Warming: After a cluster restart or scaling, query performance might be slow for the first few minutes until the "hot" data is pulled from S3 back into the local SSD cache.
* S3 Latency: If your S3-compatible storage (like MinIO) is unstable or under high load, it will directly impact ingestion and query performance for "cold" data.
In Shared-Nothing Mode:
* Tablet Balancing: When adding a new node, StarRocks must physically move tablets (data files) from old nodes to new ones. In very large clusters (100TB+), this process requires careful monitoring of disk I/O and network.
* Disk Failures: You are responsible for monitoring local SSD health. If a disk fails, StarRocks must rebuild the missing replicas from other nodes.
Summary Verdict
* Choose Shared-Nothing if you require the most "vetted" code path, need built-in BACKUP/RESTORE commands, or are running on hardware where you manage your own disks.
* Choose Cloud-Native if you want the operational simplicity of S3 durability (no more worrying about disk-level replication) and the ability to scale your compute nodes up and down in seconds without moving data.
Recommendation: For most modern cloud deployments, the benefits of Cloud-Native (elasticity and S3 durability) now outweigh its relative youth compared to Shared-Nothing. If you choose Cloud-Native, just ensure you are on v3.2 or later for the most stable experience.
References
• deployment/shared_data/feature-support-shared-data.md
• faq/shared_data_faq.md
• introduction/Architecture.md
• administration/management/BE_configuration.md
• administration/management/FE_configuration.md
ReferencesRocky
08/26/2026, 1:54 PMEliezer Talker
08/26/2026, 2:03 PMRocky
08/26/2026, 2:04 PMrun_mode configuration (shared_nothing or shared_data).
However, you can achieve a "mixed feel" in both modes through different features:
1. In Cloud-Native (Shared-Data) Mode
While the source of truth for all tables is S3, you effectively have the data on disk too.
* The "Disk" part: Every node (CN) has a local SSD cache. When you query or write data, StarRocks stores it on the local disk.
* Performance: If your "hot" data fits in your local SSDs, StarRocks will read it from the disk exactly like the Shared-Nothing mode. It only goes to S3 for "cold" data that has been evicted from the cache.
* Best for: When you want the convenience of S3 (easy scaling, high durability) but the speed of local disks for your active data.
2. In Classic (Shared-Nothing) Mode
The source of truth for your internal tables is the local disk, but you can still use S3.
* Internal Tables: Stored strictly on the BE nodes' local disks (replicated for safety).
* External Tables (S3/Iceberg): You can create an External Catalog to query data residing on S3 (Iceberg, Hive, Delta Lake, or even raw Parquet).
* Best for: When you have a core set of "mission-critical" high-speed tables on local disks and want to join them with massive, cheaper datasets sitting in a data lake on S3.
Summary Comparison
Feature | Shared-Nothing | Cloud-Native (Shared-Data)
Cluster Mode | run_mode = shared_nothing | run_mode = shared_data
Native Tables | Stored on Local BE Disks | Stored on S3 + Cached on CN Disks
External S3 Tables | Supported (via Catalog) | Supported (via Catalog)
Can you mix? | No. One cluster, one mode. | No. One cluster, one mode.
Important Note: You cannot change a cluster from one mode to the other after it is created. You would need to set up a new cluster and migrate the data.
References
• administration/management/FE_configuration.md
• deployment/shared_data/feature-support-shared-data.md
• introduction/Architecture.md
References
• administration/management/FE_configuration.md
• deployment/shared_data/feature-support-shared-data.md
• introduction/Architecture.md
References
• deployment/shared_data/feature-support-shared-data.md
• introduction/Architecture.md
• administration/management/FE_configuration.md