Skip to main content

Load Best Practices and Performance Tuning

Choose a load method, batch size, and concurrency that meet your freshness requirements without creating excessive small transactions. In VeloDB Cloud, compute clusters write to shared object storage. Host configuration and storage durability are managed by the service.

Quick navigation​

ConcernRecommended PracticeSection
Choose a load methodSelect by data source and real-time requirementsChoose an Appropriate Load Method
Table modelPrefer the Duplicate Key modelTable Model and Indexes
Partitioning and bucketingUse 1-10 GB per tablet as a starting estimatePartitioning and Bucketing Configuration
Random bucketingEvaluate load_to_single_tablet for random bucketingRandom Bucketing Load Optimization
High-frequency small loadsClient-side batching plus Group CommitBatching Strategy
Number of partitions per loadRestrict to a small number to avoid too many MemtablesPartition Load and Memory Control
Large data loadChoose batches within method limits and your retry budgetLarge-Scale Data Batched Load
Broker Load concurrencySplit compressed or columnar files for concurrencyBroker Load Concurrency
Stream Load concurrencyTune client concurrency graduallyStream Load Concurrency

Choose an appropriate load method​

VeloDB Cloud provides several load methods that share the same core workflow but are optimized for different scenarios. Choose one based on your data source and business requirements:

Load MethodProtocolExecution ModeTypical Data SourcesApplicable Scenarios
Stream LoadHTTPSynchronousLocal files, data streamsReal-time writes (such as data pushed by applications)
Broker LoadSQLAsynchronousHDFS, S3, and other external storageLarge-scale batch load
Routine LoadSQLAsynchronous streamingKafkaReal-time synchronization of message queue data, with Exactly-Once support
Insert Into / SelectSQLSynchronous by defaultVeloDB Cloud tables, Hive, MySQL, S3 TVFETL jobs, external data integration
MySQL LoadMySQL LOAD DATASynchronousLocal CSV filesSmall-scale tests or migration for MySQL users (FE forwards as Stream Load)

Load best practices​

The following sections address several common concerns in data load and provide best practices that you can apply directly.

Table model and indexes​

Table model selection​

Use the Duplicate Key model when you need to retain raw rows without deduplication or aggregation:

  • It only stores raw data, with no aggregation or deduplication, giving the shortest load path.
  • It avoids write-time aggregation and deduplication. Query performance still depends on the workload, indexes, and data distribution.
  • The Aggregate model needs to aggregate by Key columns and the Unique Key model needs to deduplicate. Both add extra computation (sorting, deduplication) on the BE side during the MemTable stage and increase CPU and memory consumption.

Choose the Aggregate or Unique Key model only when you actually need aggregation or deduplication by Key. For more information, see Data Model.

Index control​

Indexes (such as bitmap indexes and inverted indexes) need to be updated synchronously during load and increase write maintenance cost. Recommendations:

  • Create indexes only for frequently queried fields.
  • Avoid redundant indexes to reduce index building and validation on BE during writes, lowering CPU and memory usage and improving load throughput.

Partitioning and bucketing configuration​

Partitioning and bucketing determine how data is distributed across BE nodes and the degree of parallelism, directly affecting load and query performance.

Single tablet size: 1-10 gb​

Use 1 to 10 GB of compressed data per tablet as an initial sizing estimate, then adjust for the workload and cluster size:

Tablet SizeImpact
Too smallPoor aggregation effect, increased pressure on metadata management
Too largeHigher per-tablet processing and recovery cost
1-10 GB (recommended)Starting point for balancing write parallelism and metadata overhead

Estimate the bucket count per partition with bucket count = estimated compressed data size per partition / target tablet size. Combine this with an appropriate bucket key (a column with a suitable value distribution) to avoid data skew, balance the load across BE nodes, and improve parallel write efficiency.

For details, see Data Distribution.

Partition design: reduce distribution and memory pressure​

Partition by the business query pattern (such as time or region) so that during load, data is distributed only to the target partitions, avoiding processing metadata and files of unrelated partitions. In addition:

  • Writing to multiple partitions at the same time activates a large number of Tablets. Each active tablet writer can occupy its own MemTable, significantly increasing memory pressure on BE.
  • When memory is tight, an early Flush is triggered, generating many small Segment files and causing frequent Compaction and write amplification.

By limiting the number of active partitions (such as loading day by day), you can reduce the number of simultaneously active Tablets, ease memory pressure, generate larger Segment files, and reduce the Compaction load, thereby improving parallel write efficiency and subsequent query performance.

Random bucketing load optimization​

When using Random bucketing, you can enable single-tablet load mode by setting load_to_single_tablet=true:

  • Data is written directly to a single tablet, reducing the number of tablet writers for that load. The cluster can still use network communication to coordinate and write the data.
  • Concentrating writes on a single tablet reduces the generation of small Segment files and avoids the write amplification caused by frequent Compaction.
  • It can reduce small-file overhead, but concentrating a load on one tablet can limit its parallelism. Measure the effect on your workload.

For details, see Random Bucketing.

Batching strategy​

Loads create transactions and flush in-memory data into Segment files. Cloud transaction state is managed through the metadata service. High-frequency small-batch loads (KB-level) cause:

  • Frequent transaction and metadata operations.
  • Frequent BE MemTable flushes, generating many small Segment files.
  • Frequent Compaction, leading to severe write amplification.

You can mitigate this by combining client-side and server-side batching:

Batching MethodApplicable ScenariosRecommended Practice
Client-side batchingBatch writes that the client controlsAccumulate data on the client to hundreds of MB to several GB before initiating a load. Replacing many small transactions with a single large one reduces the frequency of transaction operations and MemTable flushes, avoiding storage fragmentation and the resource consumption of subsequent Compaction.
Server-side batching (Group Commit)High-concurrency, small-data-volume loadsEnable Group Commit so that the server merges multiple small batches within a short window into a single transaction. The merged large transaction generates larger Segment files and reduces background Compaction pressure. This is especially suitable for high-frequency small-batch scenarios such as logs and IoT data.

Partition load and memory control​

During load, workers first write data to in-memory MemTables. Buffer sizing is service-managed and can vary by table model and adaptive settings. When the MemTable fills up, it is asynchronously flushed to disk to generate Segment files. Each active tablet writer can have its own MemTable in memory, so the number of partitions covered by a single load directly affects memory usage:

  1. Too many partitions leads to many active Tablets, which leads to many active MemTables, which increases memory usage.
  2. When memory usage is too high, an early flush is triggered to avoid process OOM.
  3. Early flushes generate many small files, which further degrades load performance.

To achieve stable load throughput:

  • Load partitions in order: for example, load day by day so that data writes concentrate on a single partition, reducing MemTable scattering and the number of flushes, and lowering memory fragmentation and I/O pressure.
  • Strictly control the number of partitions covered by a single load to avoid early flushes triggered by too many MemTables.

Large-scale data batched load​

When there are many files and the data volume is very large, load in batches to reduce the cost of retries and avoid concentrated impact on BE memory and disk:

Data SourceRecommended Load MethodRecommended Batch Size
Remote files such as HDFS or object storageBroker LoadEach batch up to 100 GB as an initial planning guideline, subject to method-specific limits and retry cost
Large local filesDoris Streamloader (auto-batching)Controlled automatically by the tool

Broker Load concurrency​

Concurrency strategies vary by file type:

  • Compressed text files: use multiple files when the compression format prevents splitting within a file.
  • Parquet and ORC files: row groups and stripes can provide scan parallelism. Avoid assuming that every columnar file is unsplittable. Core 26.1.3 release notes include improved refinement of eligible source splits on execution nodes.
  • Uncompressed CSV and JSON files: eligible files can be split and read concurrently, subject to format and scanner constraints.

For method-specific concurrency and scanner limits, see Broker Load.

Stream Load concurrency​

Increase client concurrency gradually while measuring throughput, visibility delay, errors, and cluster utilization. Stop increasing it when throughput plateaus or errors and latency rise. The upstream values of 128 HTTP workers and 512 scanner threads do not establish a Cloud concurrency limit. Service thread-pool settings are managed by VeloDB Cloud support.

Concurrency trade-offs for low-latency scenarios​

For low-latency scenarios such as real-time monitoring:

  • Reduce concurrency appropriately to avoid resource contention.
  • Combine with the asynchronous mode (async_mode) of Group Commit to merge small transactions and reduce transaction commit latency.

VeloDB Cloud load internals​

Understanding the following internals helps you make better tuning decisions in complex scenarios.

Design philosophy​

VeloDB Cloud separates compute from persistent storage. Data loading involves the following components:

  • Frontend (FE): validates requests and permissions, manages database and table definitions, plans loads, schedules jobs, and coordinates transaction operations.
  • Backend (BE): executes load tasks, processes incoming data, generates Segment files, and writes them to shared object storage. BE nodes also use local storage for caches and transient data, such as Group Commit WALs.
  • Metadata service (Meta Service): manages tablet and Rowset metadata and persists transaction state for the shared-storage architecture.
  • Shared object storage: stores durable table data independently of the compute clusters.

The data load design aims to meet diverse business needs such as real-time writes, streaming synchronization, batch loading, and external data source integration. Its core principles include:

Design GoalImplementation
Consistency and atomicityEach transaction commits its accepted rows atomically. Filters can exclude rows. Supported label-based retries avoid duplicate submissions within the label retention window. Group Commit has different acknowledgment and retry semantics.
FlexibilitySupports a variety of data sources (local files, HDFS, S3, Kafka, and so on) and formats (CSV, JSON, Parquet, ORC, and so on) to fit different scenarios.
EfficiencyLeverages the distributed architecture to process data in parallel, with multiple BE nodes processing data concurrently to improve throughput.
SimplicityProvides lightweight ETL functionality so that you can clean and transform data during load, reducing dependence on external tools.
Flexible modelingSupports the Duplicate Key, Unique Key, and Aggregate Key models, allowing data aggregation or deduplication during load.

Common load workflow​

Regardless of the load method (Stream Load, Broker Load, Routine Load, and so on), the core workflow is essentially the same:

  1. Submit the load task

    1. You submit a load request through a client (such as HTTP, JDBC, or a MySQL client), specifying the data source (such as a local file, Kafka topic, or HDFS file path), target table, file format, and load parameters (such as delimiter and error tolerance).
    2. For load methods that support client-supplied labels, use a unique Label for each logical batch and reuse it only when checking or retrying that batch. Group Commit generates a shared label and does not provide per-request label deduplication. For example, in Stream Load you specify the Label through an HTTP header.
    3. The VeloDB Cloud Frontend (FE) receives the request, validates permissions, checks whether the target table exists, and parses the load parameters.
  2. Task assignment and coordination

    1. FE analyzes data distribution (based on the table's partitioning and bucketing rules), generates a load plan, and selects a Backend (BE) node as the Coordinator to coordinate the entire task.
    2. Use the generated warehouse endpoint for Stream Load. The service selects the coordinator and supplies the table metadata.
    3. The load plan distributes data to multiple BE nodes to ensure parallel processing for higher efficiency.
  3. Data reading and distribution

    1. The Coordinator BE reads data from the data source (for example, pulling messages from Kafka, reading files from S3, or directly receiving an HTTP data stream).
    2. VeloDB Cloud parses the data format (such as splitting CSV or parsing JSON) and supports user-defined lightweight ETL operations, including:
      • Pre-filtering: filter raw data to reduce processing overhead.
      • Column mapping: adjust the correspondence between source columns and target table columns.
      • Data transformation: process data using expressions.
      • Post-filtering: filter the transformed data.
    3. After parsing, the Coordinator BE distributes data to multiple downstream Executor BEs according to the partitioning and bucketing rules.
  4. Data write

    1. Data is distributed to multiple BE nodes and written into in-memory tables (MemTables), sorted by Key columns. For the Aggregate or Unique Key model, VeloDB Cloud aggregates or deduplicates by Key (using SUM, REPLACE, and so on).
    2. When a MemTable is flushed or the task ends, workers generate columnar Segment files that make up a Rowset. Cloud workers persist these files in shared object storage.
    3. Each BE processes its assigned data independently and reports its status to the Coordinator after the write completes.
  5. Transaction commit and publish

    1. The load execution path requests transaction commit through the Cloud transaction manager and metadata service. A committed, visible transaction makes its accepted rows queryable. This path does not use a customer-configurable majority of local BE replicas.
    2. A failed transaction is aborted. If the client loses the response, first check transaction or job status because the transaction might already have committed.
  6. Result return

    1. Ordinary synchronous Stream Load and INSERT operations return the load result directly, including success/failure status and error details (such as ErrorURL).
    2. Asynchronous methods (such as Broker Load) return a task ID and Label. You can use SHOW LOAD to view progress, error row count, and detailed information.
    3. Operations are recorded in audit logs to support later traceability.

MemTable forwarding​

The upstream Apache Doris document describes MemTable forwarding for INSERT INTO...SELECT in integrated storage and compute deployments. This optimization and its replica-based results do not apply to VeloDB Cloud:

  • Bottleneck of the traditional flow: the Sink node has to encode data into Block format and transfer it to downstream nodes via Ping-pong RPC, which involves multiple rounds of encoding and decoding and increases overhead.
  • Optimization: the Sink node directly handles MemTables, generates Segment data, and transfers it via Streaming RPC. This reduces encoding/decoding and transfer waiting, and provides more accurate memory backpressure.
  • Performance gain: the upstream source reports that load time drops to 36% in single-replica scenarios and 54% in three-replica scenarios, with overall performance improving by more than 100%.
  • Applicable scope: the described optimization requires an integrated storage and compute deployment, rather than the Cloud architecture.

Load in the compute-storage decoupled architecture​

In the compute-storage decoupled architecture, load optimization focuses on decoupling data storage and transaction management:

  • Data storage
    • Durable table data resides in shared object storage. Workers upload generated Segment files, while local storage serves caches and other transient state such as Group Commit WALs.
    • The BE local File Cache asynchronously caches hot data, improving query hit rate through TTL and Warmup strategies.
    • Metadata (such as Tablet and Rowset metadata) is stored by Meta Service in FoundationDB, instead of in the local RocksDB on BE.
  • Transaction processing
    • FE coordinates transaction operations through Meta Service, which persists transaction state independently of the FE Edit Log path.
    • Meta Service manages transactions through standard interfaces (beginTransaction, commitTransaction) and relies on FoundationDB's global transaction capabilities to ensure consistency.
    • The Cloud transaction manager uses metadata-service operations to begin, commit, and abort transactions. Execution paths still involve FE planning and coordination.

Trade-offs between latency and throughput​

The latency and throughput of data load often need to be balanced in real business scenarios:

  • Lower latency: lets you see the latest data sooner, but smaller write batches and higher write frequency lead to more frequent background Compaction, consuming more CPU, I/O, and memory, and increasing pressure on metadata management.
  • Higher throughput: by increasing the data volume per load and reducing the number of loads, you significantly lower metadata pressure and background Compaction overhead, improving overall system performance. However, the latency between writing data and its visibility increases.

Therefore, while meeting the latency requirements of your business, maximize the data volume per load as much as possible to improve throughput and reduce system overhead.

Upstream test data​

The following measurements are retained from Apache Doris documentation. They describe the stated self-managed test setup, not a VeloDB Cloud warehouse. The source does not provide the complete software version and execution configuration for the Flink test. These results have not been independently reproduced on VeloDB Cloud and are not throughput or latency guarantees.

The test uses the Flink Connector in batched-write mode, focusing on end-to-end latency and load throughput. The batching interval is controlled by the Flink Connector parameter sink.buffer-flush.interval. For details on using the Flink Connector, see Flink Connector.

Machine configuration:

  • 1 FE: 8-core CPU, 16 GB memory
  • 3 BEs: 16-core CPU, 64 GB memory

Dataset:

  • TPCH lineitem data

Load performance under different batching intervals and concurrency levels:

Batching interval (s)Load concurrencyBucket countThroughput (rows/s)End-to-end average latency (s)End-to-end P99 latency (s)
0.213260730.2110.517
1132315860.711.39
10132674375.6510.90
201329376910.96220.682
6013212500032.4662.17
0.2103293000.380.704
11032346330.751.47
101032820235.4410.43
20103213973111.1222.68
60103217164232.3761.93

Effect of different bucket counts on load performance:

Batching interval (s)Load concurrencyBucket countThroughput (rows/s)End-to-end average latency (s)End-to-end P99 latency (s)
1104347220.862.28
11016345260.81.52
11032346330.751.47
11064348290.811.51
110128347220.831.55

Group Commit test​

For high-frequency small-batch loads, evaluate Group Commit to reduce transaction overhead. For Group Commit performance test data, see Group Commit Performance.

FAQ​

Q1: How do I choose an appropriate load method?

Choose by data source and real-time requirements: use Stream Load for real-time pushes of local files; Broker Load for large batches in HDFS/S3; Routine Load for streaming data from Kafka; Insert Into / Select for ETL between external tables or VeloDB Cloud tables. Use MySQL Load for MySQL-compatible scenarios.

Q2: Why do high-frequency small-batch loads significantly affect performance?

High-frequency small loads cause VeloDB Cloud to perform Compaction frequently, leading to severe write amplification. Either accumulate data on the client to several MB to several GB, or enable Group Commit to batch on the server side.

Q3: What should I do if loads produce many small files and Compaction pressure is high?

Enable Group Commit to merge small transactions, or accumulate data on the client to hundreds of MB to several GB before loading. At the same time, review the partitioning and bucketing design to avoid having too many active Tablets.

Q4: Why should a single load not cover too many partitions?

Each active tablet writer can hold a MemTable in memory. When the total memory occupied by active Memtables is too high, an early flush is triggered to avoid OOM, generating many small files and degrading load performance. Limiting the number of partitions in a single load alleviates this issue.

Q5: Is the data volume per load always better when larger?

No. The upstream 100 GB batch recommendation is a planning guideline, not a universal request limit. Select a batch size within the load method limits and your retry budget. An overly large batch increases retry cost and the impact on BE memory and disk. For large local files, you can use the streamloader tool, which automatically batches.

Q6: Why is a Tablet size of 1-10 GB recommended?

A tablet that is too small increases metadata overhead and reduces batching efficiency. A tablet that is too large increases per-tablet processing and recovery cost. 1-10 GB is an initial sizing estimate. Adjust it for query performance, write parallelism, and metadata overhead in your warehouse.

Q7: How should I set Stream Load concurrency?

Increase client concurrency gradually and measure throughput, errors, and visibility delay. There is no verified universal 128/512 request limit for VeloDB Cloud. Contact VeloDB Cloud support for service-side capacity or thread-pool investigations.

Q8: In which scenarios does MemTable forwarding take effect?

The upstream optimization applies only to INSERT INTO...SELECT in an integrated storage and compute deployment. The upstream source reports load times of 36% and 54% of the original for one- and three-replica tests, respectively. These are upstream measurements without a complete reproduction configuration, not Cloud results. The compute-storage decoupled mode does not currently support this optimization.

Q9: How do I avoid data skew?

Start with an estimated 1-10 GB of compressed data per tablet and adjust the bucket count for your workload. Choose a bucket key with a suitable value distribution. In random bucketing scenarios, you can enable load_to_single_tablet=true to reduce distribution overhead.

Troubleshooting​

SymptomPossible CauseInvestigation and Resolution
Low load throughput, frequent CompactionHigh-frequency small-batch loads cause write amplificationBatch on the client side, or enable Group Commit
Many small files generated during loadA single load covers too many partitions, causing early Memtable flushReduce the number of partitions per load; load partitions in order
Long delay before loaded data is visibleTransaction or visibility processing is delayedCheck the result and status interface for the load method and contact VeloDB Cloud support if the delay persists
BE OOM or frequent FlushToo many simultaneously active partitions/Tablets, MemTables scatteredLoad partitions in order; reduce bucket count; lower concurrency
High transaction/metadata pressureHigh-frequency small-batch loads, too many transactionsEnable Group Commit, or batch on the client side; evaluate whether concurrency is too high
Compaction cannot keep up, queries slow downToo many small files, severe write amplificationIncrease the data volume per load; tune bucketing; ask VeloDB Cloud support to investigate service-side compaction when necessary
Load jitter under compute-storage decouplingObject storage QPS throttlingControl concurrency; increase the data volume per batch; ask VeloDB Cloud support to check service-side storage throttling
Load reports error rowsData format mismatch, column mapping errorInspect error samples through the returned ErrorURL; adjust column mapping, delimiters, or error tolerance
Requests stall as concurrency risesClient or service resources are saturatedReduce concurrency, retain request identifiers, and contact VeloDB Cloud support
Stream Load slows under loadEndpoint or cluster capacity is saturatedReduce concurrency and ask VeloDB Cloud support to investigate
Low Broker Load concurrencyToo few eligible scan splits or too little job parallelismCheck file format, compression, row groups or stripes, and the Broker Load parallelism settings
High retry cost when a single Broker Load failsBatch size is too largeReduce batch size within the load method limits and your retry budget

Cost considerations​

Loading and compaction consume cluster compute and storage. Test on a representative sample, stop load generators after measuring, and remove test data when it is no longer needed. See Billing.