This document provides architectural details, property matrices, activation criteria, and workload tuning scenarios for the BigQuery Storage Read API and BigQuery Storage Write API integrated into the BigQuery JDBC Driver.
The Storage Read API streams query result sets over high-speed gRPC channels using Apache Arrow format, bypassing standard REST JSON serialization for large datasets.
| Property Name | Connection Parameter | Default Value | Functional Role |
|---|---|---|---|
EnableHighThroughputAPI |
EnableHighThroughputAPI=true |
false |
Master Toggle: Must be true to enable Read API evaluation. |
HighThroughputMinTableSize |
HighThroughputMinTableSize=10000 |
10000 |
Minimum Row Threshold: Minimum total rows (totalRows) required. |
HighThroughputActivationRatio |
HighThroughputActivationRatio=2 |
2 |
Page Ratio Threshold: totalRows / MaxResults ratio required. |
MaxResults |
MaxResults=10000 |
10000 |
Page Size: Controls rows per page in standard REST calls. |
When EnableHighThroughputAPI=true is set, the driver transparently switches to the Storage Read API if all of the following conditions are met:
-
Master Toggle:
EnableHighThroughputAPI=trueis set. -
Minimum Row Threshold: The query returns at least
HighThroughputMinTableSizerows (default:$\ge 10,000$ rows). -
Multiple Response Pages: The result set spans more than one page (total rows exceed
MaxResults). If all rows fit on page 1, standard REST is used to avoid unnecessary gRPC stream setup. -
Activation Ratio Test: The ratio of total rows to page size (
$\frac{\text{totalRows}}{\text{MaxResults}}$ ) exceedsHighThroughputActivationRatio(default:$> 2$ ).
Note
Automatic Permission Fallback: If EnableHighThroughputAPI=true is set but the connecting principal lacks the BigQuery Read Session User IAM role, the driver catches the PERMISSION_DENIED status and automatically falls back to standard REST JSON pagination.
| Workload Scenario | EnableHighThroughputAPI |
HighThroughputMinTableSize |
HighThroughputActivationRatio |
MaxResults |
Execution Mechanism | Use Case |
|---|---|---|---|---|---|---|
| Standard REST (Default) | false |
10000 (ignored) |
2 (ignored) |
10000 |
REST JSON Pagination | Small/medium queries; standard REST security policies. |
| Default Production Extractions | true |
10000 |
2 |
10000 |
gRPC Storage Read API (for results |
Standard analytical reports and ETL extracts. |
| Aggressive Streaming | true |
100 |
0 |
50 |
gRPC Storage Read API (for results |
High-speed streaming for smaller analytical datasets. |
| Bulk ETL Analytics | true |
50000 |
5 |
10000 |
gRPC Storage Read API (for results |
Large multi-gigabyte dataset extractions. |
The Storage Write API streams high-throughput bulk insertions over gRPC channels for PreparedStatement.executeBatch() calls.
| Property Name | Connection Parameter | Default Value | Functional Role |
|---|---|---|---|
EnableWriteAPI |
EnableWriteAPI=true |
false |
Master Toggle: Must be true to enable Storage Write API streaming. |
SWA_ActivationRowCount |
SWA_ActivationRowCount=3 |
3 |
Activation Threshold: Minimum batch size added via addBatch() required to trigger SWA. |
SWA_AppendRowCount |
SWA_AppendRowCount=1000 |
1000 |
Chunk Size: Maximum rows per gRPC append payload before flushing. |
When EnableWriteAPI=true is set, the driver evaluates the batch size during PreparedStatement.executeBatch():
-
At or Above Threshold (
$\ge \text{SWA_ActivationRowCount}$ ): The driver opens a gRPC Storage Write stream and appends batch records in payload chunks governed bySWA_AppendRowCount. -
Below Threshold (
$< \text{SWA_ActivationRowCount}$ ): The driver uses standard SQL DML (INSERT INTO ...) to avoid gRPC stream overhead for tiny batches.
| Workload Scenario | EnableWriteAPI |
SWA_ActivationRowCount |
SWA_AppendRowCount |
Execution Mechanism | Use Case |
|---|---|---|---|---|---|
| Standard SQL DML (Default) | false |
3 (ignored) |
1000 (ignored) |
Concatenated REST SQL DML | Small transactional DML; standard SQL compatibility. |
| Default High-Throughput ETL | true |
3 |
1000 |
gRPC SWA stream (batches |
Standard batch loader applications (Spring Batch, Spark). |
| Real-Time Micro-Batching | true |
1 |
100 |
gRPC SWA stream (batches |
High-frequency streaming events (Kafka/Flink consumers). |
| High-Volume Bulk Ingestion | true |
100 |
5000 |
gRPC SWA stream (batches |
Large nightly bulk ETL loading millions of records. |