<@U0A71G31CDV> youl support iceberg via a external...
# questions-and-troubleshooting
e
@Rocky youl support iceberg via a external catalog but your share-data cluster mode only supports starRocks format that is offloaded to s3, why ?
r
The choice to use a native format for internal tables in StarRocks' shared-data (cloud-native) architecture—even when stored on S3—comes down to the fundamental difference between a database engine's internal storage and an open data lake format. Here is why StarRocks uses its native segment format for shared-data clusters: 1. Performance & Vectorization StarRocks' native format (segment files) is specifically designed for its vectorized execution engine. It includes proprietary optimizations like: * Advanced Indexing: Native tables support built-in indexes (Bitmap, Bloom Filter, Zone Maps, and especially the Primary Key index) that are not part of the standard Iceberg/Parquet spec. * Fine-grained I/O: The segment format allows the engine to skip data at a much more granular level than Parquet, which is critical for achieving sub-second query latency. 2. Full ACID & Primary Key Support The Primary Key table model is a core StarRocks feature that allows for high-frequency, real-time updates and deletes. * Implementing the performance level of StarRocks' Primary Key engine on top of a general-purpose format like Iceberg would introduce significant overhead. * By using its own format, StarRocks can manage its own metadata service (StarOS) and transaction logs to handle complex compaction and versioning more efficiently than the Iceberg manifest system allows for high-concurrency writes. 3. Feature Consistency Shared-data clusters aim to provide the same functionality as shared-nothing clusters. By reusing the native segment format, StarRocks ensures that all table types (Duplicate, Aggregate, Unique, and Primary Key) work identically across both architectures, allowing users to migrate or choose architectures without losing engine-specific features. 4. Internal vs. External Use Cases * Internal (Shared-Data): Use this when StarRocks is the primary owner of the data and you need the absolute highest performance for your BI and real-time analytics. * External (Iceberg Catalog): Use this for interoperability. If you need your data to be readable by Spark, Trino, or Flink, you should use an Iceberg External Catalog. StarRocks allows you to write to these tables via
INSERT INTO
or
CTAS
, but they are treated as external data sources because StarRocks does not control their entire lifecycle/optimization. In short: StarRocks supports Iceberg for openness, but it uses its native format for speed and advanced database-level features. If it used Iceberg for its internal storage, it would have to sacrifice the performance and real-time update capabilities that define the engine. References • data_source/catalog/iceberg/iceberg_catalog.md • deployment/shared_data/feature-support-shared-data.md • deployment/shared_data/hdfs.md
The choice to use a native segment format for shared-data (cloud-native) clusters, rather than a standard open format like Apache Iceberg, is driven by the need for performance parity with local-disk-based databases and the requirements of StarRocks' high-frequency update engine. Here is the breakdown of why this distinction exists: 1. Vectorized Engine Optimization StarRocks' native format (segment files) is co-designed with its vectorized execution engine. * Indexing: Internal tables support specific indexes (Primary Key indexes, Bitmap indexes, and Zone Maps) that allow the engine to skip data at a much more granular level than the standard Parquet files used by Iceberg. * I/O Efficiency: In shared-data mode, StarRocks implements "I/O Merge" and "Parallel Scan" optimizations that are specifically tuned for its segment format. Benchmarks show that shared-data clusters using the native format are typically 1.4x to 2x faster than querying the same data via a Hive or Iceberg catalog without cache. 2. Real-Time Updates (Primary Key Model) A key feature of StarRocks is its Primary Key table model, which supports high-concurrency UPSERTs. * This model relies on Delete Vectors and a specialized metadata service (StarOS) to manage data versions and compaction in real-time. * Implementing this level of update performance on top of Iceberg’s manifest-based snapshot system would introduce significant latency and overhead, making it unsuitable for the sub-second ingestion-to-query latency that StarRocks users expect. 3. Metadata Management vs. Interoperability * Shared-Data (Native): StarRocks acts as the "source of truth." It manages the lifecycle of the data, including automated compaction and vacuuming of old versions on S3. This tight control allows the Frontends (FE) to plan queries much faster because they don't have to parse external manifest files for every query. * External Catalog (Iceberg): This is designed for interoperability. If your goal is to share data with Spark, Trino, or Flink, you should use an Iceberg Catalog. StarRocks supports writing to Iceberg tables via
INSERT INTO
, but it treats them as external because it cannot guarantee the same performance optimizations (like the Primary Key index) that it can with its own format. 4. Can you use Iceberg instead? If you prefer the openness of Iceberg over the performance of the native format, you can still achieve a "shared-data" experience: 1. Deploy a StarRocks cluster (shared-data or shared-nothing). 2. Create an Iceberg Catalog pointing to your S3 bucket. 3. Use
INSERT INTO iceberg_catalog.db.table SELECT ...
to store your data there. Summary: The native format is for speed and advanced database features (like real-time updates), while the Iceberg catalog is for ecosystem compatibility. By offering both, StarRocks lets you choose the right tool for each specific workloads requiring either maximum performance or maximum openness. References • deployment/shared_data/feature-support-shared-data.md • data_source/catalog/iceberg/iceberg_catalog.md • deployment/shared_data/s3.md References • release_notes/release-3.3.md • data_source/feature-support-data-lake-analytics.md
e
@Rocky youl are open source so why isnt the starRocks format open source like iceberg ?
r
The distinction between being open source and having an open standard format is an important one. While StarRocks is 100% open source (Apache 2.0), its native storage format is a "private" implementation detail of the engine rather than a cross-industry standard like Apache Iceberg. Here is why the StarRocks native format (Segment files) isn't "open" in the same way Iceberg is: 1. Performance "Coupling" Open formats like Iceberg and Parquet are designed for interoperability. They must remain general enough that Spark, Trino, Flink, and StarRocks can all read them. StarRocks' native format is tightly coupled to its vectorized execution engine. It includes proprietary optimizations that aren't part of the Iceberg/Parquet specs: * Segment-level Indexes: It uses "Short-key" (prefix) indexes and specialized Zone Maps designed for sub-second point and range seeks. * Vectorized Encoding: Data is encoded in a way that allows the CPU to process it directly in batches (SIMD), which is why it can be 2x faster than Parquet. 2. The Primary Key "Engine" One of StarRocks' biggest advantages is its Primary Key table model, which handles real-time updates and deletes. * This relies on Delete Vectors and a specialized metadata layer to handle high-concurrency UPSERTs. * Trying to force these complex, real-time update mechanics into a general-purpose format like Iceberg would sacrifice the very speed that makes StarRocks unique. 3. Open Source vs. Open Standard * The Code is Open: Because StarRocks is open source, the code to read and write its segment format is public. Anyone could write a connector for it, but other engines (like Spark) don't because the format changes as StarRocks adds new performance features. * Iceberg is a Standard: Iceberg is a specification. Its goal is to ensure that data written by one tool is perfectly understood by another forever. 4. StarRocks’ Strategy: Give You Both StarRocks doesn't want to "lock you in." Instead, it provides two paths: * Native Format: Use this for your "Hot" data. It's the "Performance Layer" where you need the fastest possible BI and real-time updates. * Iceberg/External Catalog: Use this for your "Cold" or "Shared" data. StarRocks treats Iceberg as a first-class citizen. You can even use StarRocks to write to Iceberg tables (
INSERT INTO iceberg_table
), ensuring your data remains accessible to the rest of your ecosystem. In summary: The native format isn't a standard because its job is to be the fastest possible storage for one specific engine, whereas Iceberg's job is to be the standard storage for every engine. By offering both, StarRocks lets you decide when you need absolute speed vs. absolute openness. References • introduction/what_is_starrocks.md • best_practices/table_clustering.md • integrations/data_lakes.mdx • data_source/catalog/iceberg/iceberg_catalog.md References • loading/loading_introduction/feature-support-loading-and-unloading.md • introduction/StarRocks_intro.md • developers/How_to_Contribute.md • introduction/what_is_starrocks.md
This is a common point of confusion. To clarify: the StarRocks storage format is open source (licensed under Apache 2.0), but it is not an industry standard specification like Apache Iceberg. Here is the difference between being "Open Source" and being an "Open Standard": 1. The Code is Open, the Format is "Internal" Because StarRocks is open source, the code that defines how data is written to disk (segment files) is publicly available on GitHub. Anyone can read, modify, or build a reader for it. However, unlike Iceberg, which has a strict community-governed specification and SDKs for many languages (Java, Python, Rust), the StarRocks format is an internal implementation detail designed specifically for the StarRocks engine. 2. Performance vs. Interoperability The primary reason StarRocks doesn't use Iceberg as its only format is the trade-off between speed and compatibility: * Iceberg (Open Standard): Designed to be the "lowest common denominator" so that Spark, Trino, Flink, and StarRocks can all read it. To maintain this compatibility, it cannot easily include engine-specific optimizations. * StarRocks Native (Optimized): Designed to be the "highest possible performance." It includes specialized Short-key indexes, Bitmap indexes, and Delete Vectors (for real-time updates) that are tightly coupled to StarRocks' vectorized execution engine. If StarRocks moved to a universal standard for its internal storage, it would likely lose the 2x–5x performance edge it has over general-purpose engines. 3. "Openness" is about choice StarRocks' philosophy is to provide Open Lakehouse capabilities by supporting both: * For Performance: Use the native format. It gives you the fastest BI and real-time UPSERTs. * For Openness: Use the Iceberg Catalog. StarRocks allows you to create, read, and even write (
INSERT INTO
) to Iceberg tables. This ensures your data isn't "locked in" and can be read by any other tool in your ecosystem. Summary The format isn't "closed"—it's just engine-optimized. * Iceberg is a "bridge" between different tools. * StarRocks Native is the "engine room" designed for maximum speed. By being open source, StarRocks ensures you can see how it works; by supporting Iceberg, it ensures you can take your data wherever you want. References • introduction/what_is_starrocks.md • data_source/catalog/iceberg/iceberg_catalog.md • integrations/data_lakes.mdx • deployment/shared_data/feature-support-shared-data.md References • data_source/catalog/iceberg/iceberg_catalog.md • introduction/what_is_starrocks.md • integrations/data_lakes.mdx • deployment/shared_data/feature-support-shared-data.md References • integrations/data_lakes.mdx • introduction/Features.md • data_source/data_lakes.mdx • faq/Others.md • data_source/feature-support-data-lake-analytics.md • data_source/catalog/iceberg/iceberg_catalog.md
e
@Rocky is it possible if in shared mode to say that some tables are to always be in starRocks and not in s3 ?
r
In StarRocks, the short answer is no. In shared-data (cloud-native) mode, it is not possible to designate a specific table to reside only on local disks and bypass S3 (or other object storage). Here is why this is the case and how you can achieve the performance of local storage while still being in shared-data mode: 1. The "Single Source of Truth" Principle In a shared-data cluster, the
run_mode
is set to
shared_data
at the cluster level. In this mode, the remote object storage (S3/HDFS) is the primary, persistent source of truth. * All permanent tables you create are of type
CLOUD_NATIVE
. * Every write operation must commit to the remote storage to ensure data durability and consistency across multiple Compute Nodes (CNs). * You cannot mix
shared_data
and
shared_nothing
(local-disk-only) modes in the same cluster. 2. Achieving "Local" Performance via Data Cache While you cannot prevent data from being written to S3, you can effectively "pin" tables to local disks using the Data Cache feature. This gives you the speed of local NVMe/SSDs while retaining the scalability of S3. You can configure a table to stay in the local cache by using these properties:
Copy code
sql
CREATE TABLE my_table (
    ...
)
PROPERTIES (
    "datacache.enable" = "true",
    -- Set a long duration or omit it to keep data in cache as "hot"
    "datacache.partition_duration" = "1 YEAR" 
);
* Write-through Cache: When you load data, it is written to S3 and the local disk cache simultaneously. * Cache Warmup: You can use the
CACHE SELECT
command (StarRocks v3.3+) to proactively pull data from S3 into the local cache before running queries. 3. Temporary Tables (v3.3.1+) If your "tables" are actually intermediate results or session-based scratchpads, StarRocks recently introduced Temporary Tables. * These are session-scoped and automatically deleted when the session ends. * However, even for temporary tables in a shared-data cluster, the default behavior is to use the cluster's default storage volume (S3). Summary Comparison Feature | Shared-Nothing (Local) | Shared-Data (S3) Source of Truth | Local BE Disks | S3 / Object Storage High Availability | Replicas (3x storage cost) | S3 Native (1x storage cost) Performance | Constant local disk speed | Local disk speed if cache is hit Scaling | Rebalancing data (Slow) | Instant (Stateless CN nodes) If you have a strict requirement for a table to never touch S3 (e.g., for security or extreme cost-saving on S3 API calls), you would currently need to maintain a separate shared-nothing cluster for those specific workloads. References • deployment/shared_data/s3.md • introduction/Architecture.md • table_design/StarRocks_table_design.md • deployment/shared_data/feature-support-shared-data.md References • introduction/Architecture.md • quick_start/shared-data.md • table_design/table_design.md • deployment/shared_data/s3.md
e
@Rocky use case is that we got a table of alerts and ETL tables for dashboard analytics that need sub 100ms response time
r
To achieve sub-100ms response times in shared-data mode (cloud-native), you don't actually need the table to be "local-only." StarRocks provides a "warm" data path that delivers local-disk performance while keeping S3 as the durable source of truth. For your specific use cases (alerts and dashboard ETL), here is the recommended architecture to hit that <100ms target: 1. The "Alerts" Table: Primary Key + Row-Columnar If your alerts require point lookups (e.g.,
SELECT * FROM alerts WHERE id = 123
) or high-concurrency UPSERTs, you should use the Primary Key model with Row-Columnar storage (introduced in v3.2). * Why: StarRocks is normally columnar, which is slow for retrieving a single full row. Row-columnar storage creates an additional row-based store that allows for sub-millisecond point lookups. * Property:
Copy code
sql
    PROPERTIES (
        "enable_persistent_index" = "true",
        "persistent_index_type" = "LOCAL", -- Keep PK index on local NVMe
        "column_context" = "{\"common_column_group\":\"pb\"}" -- Example row-store config
    )
2. The "Dashboard" Tables: Data Cache "Pinning" For dashboard analytics (aggregations), the performance bottleneck is usually S3 latency. You can bypass this by "pinning" these tables to the local NVMe cache of your compute nodes. * Write-Through Cache: In StarRocks, when you load data into a shared-data table with
datacache.enable
=
true
(the default), the data is written to S3 and the local disk cache simultaneously. Your first query will already hit the local disk, not S3. * Infinite TTL: Set the cache duration to a very long time so the data is never evicted based on time.
Copy code
sql
    PROPERTIES (
        "datacache.enable" = "true",
        "datacache.partition_duration" = "100 YEAR"
    )
3. Proactive Warming (Sub-100ms Insurance) If your ETL process finishes and you want to ensure the dashboard is fast for the very first user, use the Cache Warmup feature (v3.3+). After your ETL
INSERT
completes, run:
Copy code
sql
CACHE SELECT * FROM dashboard_etl_table;
This proactively pulls any missing data from S3 into the local NVMe cache so that the dashboard query never touches the network. Summary for your Use Case Requirement | Solution Durability | S3 (Automatic in shared-data mode) Point Lookup (<10ms) | Primary Key Table + Row-Columnar Storage Analytic Query (<100ms) | Data Cache (NVMe) + Cache Warmup (
CACHE SELECT
) Consistency | The Persistent Index (set to
LOCAL
or
CLOUD_NATIVE
) Result: You get the sub-100ms speed of local storage with the infinite scaling and lower cost of S3. In official benchmarks, a shared-data cluster with Data Cache enabled actually performs 1.2x faster than a traditional shared-nothing cluster due to more efficient I/O threading. References • deployment/shared_data/feature-support-shared-data.md • table_design/table_types/primary_key_table.md • using_starrocks/caching/block_cache.md • data_source/data_cache.md References • deployment/shared_data/s3.md • deployment/shared_data/hdfs.md
To achieve sub-100ms response times in shared-data (cloud-native) mode, you should leverage StarRocks' multi-layer caching and pre-aggregation features. Even though the data is durably stored in S3, these features ensure that hot data is served from local NVMe or memory. 1. For Alerts (High-Frequency Point Lookups) Alerts typically involve looking up a specific row or status by an ID. * Primary Key Model: Always use the Primary Key table for alerts. It is designed for real-time updates and fast lookups. * Persistent Index: In shared-data mode, ensure the Persistent Index is enabled. Set it to
LOCAL
to keep the primary key index on the local disk of your Compute Nodes (CNs). This avoids network calls to S3 for index lookups. * Row-Columnar Storage (v3.2+): Enable row-columnar storage for these tables. This allows StarRocks to retrieve an entire row in a single I/O operation (sub-1ms), rather than scanning multiple columns.
Copy code
sql
    PROPERTIES (
        "enable_persistent_index" = "true",
        "persistent_index_type" = "LOCAL",
        "column_context" = "{\"common_column_group\":\"pb\"}"
    )
2. For Dashboards (Aggregation & ETL) Dashboards usually involve
SUM
,
COUNT
, and
GROUP BY
operations. * Synchronous Materialized Views (v3.4+): If your dashboards query specific aggregates, use a Synchronous MV. These are now supported in shared-data mode. They pre-calculate the results during data ingestion, reducing query time from seconds to milliseconds. * Query Cache (v3.4+): Enable the Query Cache. It stores the final or intermediate result sets in the CN's memory. If the same dashboard is viewed by multiple users or refreshed frequently, the results are served instantly from memory.
Copy code
sql
    SET [GLOBAL] enable_query_cache = true;
3. Data Cache "Pinning" & Warmup To ensure your ETL results never wait for S3 I/O: * Data Cache: Ensure
datacache.enable = true
is set (default). * Infinite TTL: Set
datacache.partition_duration
to a very long time (e.g.,
100 YEAR
) so your "hot" dashboard data is never evicted from local SSDs to make room for older data. * Proactive Warmup: After your ETL job completes, run a
CACHE SELECT
query. This pulls the newly processed data from S3 into the local CN cache immediately, so the first dashboard user experiences sub-100ms speeds.
Copy code
sql
    CACHE SELECT * FROM your_dashboard_etl_table WHERE report_date = '2023-10-27';
4. Health Check: Compaction Score High latency in shared-data mode often comes from insufficient compaction (too many small files on S3). * Monitor the Compaction Score using
SHOW PROC '/compactions'
. * If the score is consistently > 10, your queries will slow down as they have to merge many files. You can increase
compact_threads
in the BE/CN configuration to speed up this process. Summary Use Case | Core Optimization | Target Latency Alert Point Lookups | PK Table + Row Store + Local Persistent Index | < 10ms Dashboard Aggregates | Synchronous MV + Query Cache | < 50ms First-load Performance | Data Cache Warmup (
CACHE SELECT
) | < 100ms References • table_design/table_types/primary_key_table.md • using_starrocks/caching/query_cache.md • deployment/shared_data/feature-support-shared-data.md • using_starrocks/Materialized_view-single_table.md • faq/shared_data_faq.md References • table_design/hybrid_table.md
To achieve sub-100ms response times in shared-data mode (cloud-native), you don't need to bypass S3. StarRocks is designed to provide "local disk speed" for hot data while using S3 for cost-effective durability. For your alerts and dashboard use cases, here is how you configure your tables to hit that <100ms target: 1. For "Alerts": Primary Key Table + Row-Store If your alerts involve high-concurrency point lookups (e.g., fetching a specific alert by ID), use the Primary Key model with Row-oriented storage (available since v3.2.3). StarRocks is natively columnar (fast for analytics), but the row-store property adds a secondary row-based index that allows for sub-10ms point lookups, even in shared-data mode. * Key Property: Set
column_context
to enable the row-store (internal optimized format). * Persistent Index: In shared-data mode, keep the primary key index on local disks for maximum speed.
Copy code
sql
    PROPERTIES (
        "enable_persistent_index" = "true",
        "persistent_index_type" = "LOCAL", -- Keep the "address book" on local NVMe
        "column_context" = "{\"common_column_group\":\"pb\"}" -- Enables row-oriented optimization
    );
2. For "Dashboards": Data Cache Pinning For dashboard ETL tables (aggregations like
SUM
,
COUNT
,
GROUP BY
), you need to ensure the data is "pinned" to the local NVMe cache of your compute nodes so the query never waits on S3. * Write-Through Cache: In StarRocks, when you load data, it is written to S3 and the local disk cache simultaneously by default. Your first query will hit the local disk, not S3. * Long TTL: Ensure your dashboard data stays "hot" by setting a long partition duration.
Copy code
sql
    PROPERTIES (
        "datacache.enable" = "true",
        "datacache.partition_duration" = "1 YEAR" -- Effectively pins data to local disks
    );
3. Sub-100ms "Insurance": Cache Warmup If your ETL process finishes and you want to guarantee that the very first user who opens the dashboard gets a sub-100ms response, use the Cache Warmup feature (introduced in v3.3). After your ETL
INSERT
completes, run:
Copy code
sql
CACHE SELECT * FROM dashboard_etl_table;
This proactively pulls any data not already in the local NVMe cache from S3. You can even schedule this as a routine task to run immediately after your ETL pipeline finishes. Summary of the "Warm" Path Requirement | Solution | Speed Point Lookups (Alerts) | Primary Key + Row-Store | < 10ms Dashboard Queries | Data Cache (NVMe) | < 100ms Data Durability | S3 (Cloud-Native Storage) | (Background) By combining the Data Cache (for the data itself) and the Persistent Index (for the primary keys), you get the sub-100ms performance of a local cluster while keeping the architectural benefits of shared-data (instant scaling, lower cost). References • deployment/shared_data/feature-support-shared-data.md • table_design/table_types/primary_key_table.md • data_source/block_cache_warmup.md • introduction/what_is_starrocks.md • best_practices/primarykey_table.md References • table_design/hybrid_table.md • deployment/shared_data/feature-support-shared-data.md
To achieve sub-100ms response times in shared-data (cloud-native) mode, you must rely on StarRocks' multi-layer caching and indexing architecture. While shared-data clusters store the "source of truth" on S3, the "execution" can be entirely local. Here is the specific configuration strategy for your use cases: 1. The Alerts Table (High Concurrency & Point Lookups) For alerts, you typically need to retrieve a full row based on an ID. In shared-data mode, the Primary Key (PK) Table is your best tool. * Persistent Index on Local NVMe: In shared-data mode, the index that maps keys to data locations can be kept on the local SSD of your Compute Nodes (CN). This avoids S3 lookups during updates and queries. * Property:
"enable_persistent_index" = "true"
and
"persistent_index_type" = "LOCAL"
(v3.1.4+). * Limitation Note: The "Hybrid row-column" storage (which provides a row-store for sub-10ms lookups) is currently not supported in shared-data mode. To hit sub-100ms for alerts in shared-data mode, you must ensure your CN nodes have high-speed NVMe/SSD and sufficient Data Cache to keep the alert table's segment files local. 2. Dashboard ETL Tables (Analytical Speed) Dashboards usually involve aggregations (
GROUP BY
,
SUM
). To make these sub-100ms, you must ensure the data never leaves the CN node's local storage. * Pinning Data to Cache: Set a long duration for the cache to prevent S3 round-trips.
Copy code
sql
    PROPERTIES (
        "datacache.enable" = "true",
        "datacache.partition_duration" = "1 YEAR"
    )
* Proactive Warming (v3.3+): Immediately after your ETL job (e.g., an
INSERT INTO ... SELECT
) finishes, trigger a Cache Warmup. This "pushes" the new data into the local NVMe cache so the very first dashboard user gets a sub-100ms response.
Copy code
sql
    -- Warm up the specific data needed for the dashboard
    CACHE SELECT * FROM dashboard_table WHERE report_date = '2024-05-20';
3. Critical Infrastructure Setup To guarantee these speeds in shared-data mode, your Compute Nodes (CN) must be configured as follows: 1. Local Storage: CN nodes must have fast local disks (SSD/NVMe). Configure
storage_root_path
in
cn.conf
to point to these disks. 2. Cache Size: Ensure
starlet_star_cache_disk_size_percent
(default 90%) allows enough room to hold your "hot" alert and dashboard data. 3. Unified Cache (v3.4+): If you are on version 3.4 or later, the data lake and internal table caches are unified, making management simpler and more efficient. Summary Strategy Use Case | Table Model | Key Optimization Alerts | Primary Key |
enable_persistent_index
+
LOCAL
index type Dashboards | Duplicate/PK |
datacache.partition_duration
+
CACHE SELECT
ETL Flow | Any | Use
CACHE SELECT
immediately after Load/ETL If your alerts require sub-10ms (single-digit) latency under extremely high concurrency, you might need to consider a Shared-nothing cluster for that specific table to utilize the Hybrid row-column storage (beta), as that optimization is currently exclusive to local storage clusters with local BE local storage. References • table_design/table_types/primary_key_table.md • deployment/shared_data/feature-support-shared-data.md • using_starrocks/caching/block_cache.md • table_design/hybrid_table.md • administration/management/monitoring/metrics-shared-data.md
e
@Rocky you said "*1. For "Alerts": Primary Key Table + Row-Store* If your alerts involve high-concurrency point lookups (e.g., fetching a specific alert by ID), use the Primary Key model with Row-oriented storage (available since v3.2.3). StarRocks is natively columnar (fast for analytics), but the row-store property adds a secondary row-based index that allows for sub-10ms point lookups, even in shared-data mode. * Key Property: Set
column_context
to enable the row-store (internal optimized format). * Persistent Index: In shared-data mode, keep the primary key index on local disks for maximum speed." does this mean the table is not stored in a columnar way ?
r
To clarify my previous response and correct a important distinction: Hybrid row-column storage does not replace columnar storage; it adds a second way of storing the data simultaneously. However, there is a critical correction regarding your specific environment: 1. Correction: Shared-Data vs. Shared-Nothing I previously mentioned using row-store "even in shared-data mode." I must correct this: Currently, StarRocks shared-data (cloud-native) clusters do not support the hybrid row-column storage feature. * Shared-Nothing (Local BEs): Supports Hybrid Row-Column storage. * Shared-Data (S3/Object Storage): Does not currently support it (as of v3.3/v3.4). 2. Does this mean the table is not columnar? No. Even when the row-store property is enabled (on supported shared-nothing clusters), the table remains 100% columnar. StarRocks physically writes the data twice: 1. Columnar Format: Used for your "Dashboard Analytics" (e.g.,
SUM
,
AVG
,
GROUP BY
). 2. Row-Store Format: A redundant copy used specifically for "Alerts" (e.g.,
SELECT * FROM alerts WHERE id = 123
). When you run a query, the StarRocks optimizer automatically chooses the row-store for point lookups and the columnar store for analytical scans. This is why it is called Hybrid storage. 3. How to hit <100ms for Alerts in Shared-Data Mode Since you are in shared-data mode and cannot use the row-store, you should use these two features to achieve sub-100ms response times: A. Persistent Index (Set to LOCAL) For Primary Key tables in shared-data mode, the "index" that tracks where each row is located can be stored on the local NVMe disks of your Compute Nodes (CN) instead of S3. This eliminates the network overhead when looking up an alert ID. * Property:
"enable_persistent_index" = "true"
,
"persistent_index_type" = "LOCAL"
B. Data Cache Warmup For both your alerts and dashboard ETL tables, you must ensure the data is in the local NVMe cache of your CN nodes. * Property:
"datacache.enable" = "true"
* Action: Immediately after your ETL finishes, run
CACHE SELECT * FROM your_table;
. This "pins" the data to the local disk of the CN node. Summary for your Use Case In your shared-data cluster, your tables will be purely columnar. You will achieve the <100ms speed for alerts by: 1. Keeping the Primary Key index on the CN node's local SSD. 2. Ensuring the Columnar data blocks are "warmed up" into the CN node's local disk cache. This combination allows the CN node to find the row location instantly (from the local index) and read the data immediately (from the local cache), hitting your sub-100ms target without needing the row-store feature. References • table_design/hybrid_table.md • deployment/shared_data/feature-support-shared-data.md • using_starrocks/caching/block_cache.md • table_design/table_types/primary_key_table.md
e
@Rocky im using starRocks version 4.1.1 and when you say it writes the data twice so thats twice the storage used ?
r
In StarRocks v4.1.1, the answer depends on whether you are using Shared-Data (cloud-native) or Shared-Nothing (local storage) mode, as the features available to you differ. 1. Does it use "twice the storage"? If you enable Hybrid Row-Column Storage (the row-store feature), the storage is not exactly doubled, but it increases significantly. * How it works: StarRocks physically writes a hidden column called
__row
. This column contains all the values for that row encoded into a single binary block. * Actual Overhead: Because columnar data compresses much better (often 5x–10x) than the binary row-store data, the total storage increase is typically 1.5x to 2x the size of the original columnar-only table. * Write Performance: Loading data also takes more CPU and time because the system has to encode and write the data in two different formats simultaneously. 2. Critical Check for your Version (4.1.1) Although you are on v4.1.1, there is a limitation you must keep in mind: * If you are in Shared-Data Mode (S3/Object Storage): The Hybrid Row-Column (row-store) feature is still not supported for shared-data tables in v4.1.1. You cannot set the
column_context
property on these tables yet. * If you are in Shared-Nothing Mode: You can use it, and you will see the storage increase mentioned above. 3. Recommendation for Sub-100ms on v4.1.1 (Shared-Data) Since you are likely using Shared-Data mode (the most common reason to ask about S3/Storage costs), you should achieve your sub-100ms target using these two "storage-efficient" methods instead of the row-store: 1. Persistent Index (Local): Keep your Primary Key index on the local NVMe of your Compute Nodes (CN). This makes lookups instant without doubling your S3 storage.
Copy code
sql
    PROPERTIES (
        "enable_persistent_index" = "true",
        "persistent_index_type" = "LOCAL"
    )
2. Unified Data Cache: In v4.1.1, use the Data Cache to keep your "Alerts" and "Dashboard" data on the local disk of the CN. This gives you local-disk speed for queries (<100ms) while keeping your storage costs low on S3. * Pro Tip: After your ETL finishes, run
CACHE SELECT * FROM your_table
to ensure the data is moved from S3 to the local NVMe cache immediately. Summary: If you could use row-store, it would roughly double your storage. But since you are in shared-data mode, you don't need to pay that storage penalty; you can use the Local Persistent Index and Data Cache to hit <100ms for both alerts and dashboards. References • table_design/hybrid_table.md • deployment/shared_data/feature-support-shared-data.md • using_starrocks/caching/block_cache.md • administration/management/monitoring/metrics-shared-data.md References • table_design/hybrid_table.md • deployment/shared_data/feature-support-shared-data.md