English · IndiaLog in
Rackwave Technologies
Request quote Free consultation
DataUpdated 26 Nov 2026

BigQuery Streaming Inserts: Real-Time Ingestion Guide

BigQuery streaming inserts: Storage Write API, duplicates, quotas and cost.

Written by Arjun Mehta
  • Published25 Nov 2026
  • Read time7 min
  • Length1,370 words
Share this guide

What are BigQuery streaming inserts? BigQuery streaming inserts let applications and pipelines write rows into a table in near real time, so data is available for queries within seconds instead of waiting for a batch load. Google Cloud offers more than one streaming route, including the older insertAll API and the newer Storage Write API, which supports higher throughput, exactly-once semantics and lower cost. This guide explains how streaming works, the options available, how to choose between streaming and batch loading, how to handle duplicates, schema changes and ordering, how to design for scale and reliability, what streaming costs, how to monitor it and the mistakes that lead to duplicate rows, quota errors and surprise bills. Features and pricing change, so confirm in current Google Cloud documentation.

Short answer: Stream only when you truly need data within seconds. Prefer the Storage Write API for new work, design for duplicates and retries, use batch loads for everything else and monitor quotas, errors and cost.

When streaming makes sense

Streaming suits use cases where freshness changes decisions: fraud detection, operational dashboards, live personalisation and monitoring. For daily reports, batch loading is simpler and cheaper. Many teams stream a small set of critical events and batch the rest. See what is BigQuery and data pipelines.

BigQuery streaming diagram
Figure 1. BigQuery streaming: producer, api, buffer and how they relate.

Ingestion options compared

OptionLatencyCost profileNotes
Batch load from filesMinutes to hoursLow or no ingestion chargeBest for periodic loads
Storage Write API, default streamSecondsLower than legacy streaming, with free allowancesAt-least-once, simple to adopt
Storage Write API, committed or pending streamsSeconds or on commitSame family of pricingExactly-once semantics and transactional batch commits
Legacy insertAll APISecondsHigher per volumeSimple, best-effort de-duplication
Pub/Sub or Dataflow into BigQuerySecondsService plus ingestion chargesManaged pipeline with transformations
Change data capture connectorsSeconds to minutesConnector plus ingestionReplicate operational databases

Check the current pricing and quotas before choosing.

How data becomes queryable

  • Streamed rows first land in a write-optimised buffer and are available to queries almost immediately.
  • BigQuery later moves them into columnar storage in the background.
  • Recently streamed rows may not be fully partitioned or clustered, so performance can differ.
  • Some operations, such as certain updates and deletes on very recent data, may be limited.
  • Table copies and exports can behave differently for data still in the buffer.
  • Plan for this when running audits or comparing counts against sources.
Streaming at a glance summary
Figure 2. Streaming at a glance: freshness, api, quality at a glance.

Designing a streaming pipeline

  1. Define the event. Choose schema, keys and timestamps.
  2. Choose the API. Prefer the Storage Write API for new pipelines.
  3. Add unique ids. Include an event id so duplicates can be detected.
  4. Handle retries. Retry safely and expect duplicates.
  5. Partition the table. Partition by event time and cluster by common filters.
  6. Monitor. Track errors, latency, quotas and cost.

Duplicates, ordering and late data

IssueCauseApproach
DuplicatesRetries and at-least-once deliveryUse event ids and de-duplicate in a view or model
Out-of-order eventsNetwork and producer delaysUse event time, not arrival time, for logic
Late arrivalsMobile or batch producersAllow a window and reprocess recent partitions
Schema driftProducers add fieldsVersion schemas and allow additive changes
Bad recordsInvalid dataRoute to a dead-letter table for review

Build downstream models that assume duplicates can exist. See dbt incremental models for merge-based patterns.

Scale, quotas and reliability

  • Batch rows into reasonably sized requests rather than sending one row at a time.
  • Watch throughput and request quotas, and request increases early for growth.
  • Use exponential backoff on retries to avoid overload.
  • Buffer events in a queue so producers survive temporary failures.
  • Separate streaming tables from heavy analytical load where needed.
  • Test peak load before launch.

Cost and optimisation

Streaming is charged per volume ingested, and the rate depends on the API. Do not stream data that nobody needs in real time. Reduce row size by sending only useful fields, compress where possible and prefer batch loading for bulk or historical data. Review ingestion cost in billing reports alongside query cost. See cost control.

  • Stream only what needs seconds-level freshness.
  • Send compact rows.
  • Batch load history and bulk data.
  • Report ingestion cost by table.

Schema design for streaming tables

Design schemas with change in mind. Use required fields sparingly, prefer additive changes such as new nullable columns and keep a version field in each event so consumers can handle differences. Choose clear types for timestamps, store event time and ingestion time separately and avoid deeply nested structures that are costly to query. Agree schema changes with producers, and test them in a staging table before production.

  • Prefer additive schema changes.
  • Store event and ingestion time.
  • Version events.
  • Test changes in staging.

Testing and failure handling

Test streaming pipelines before launch with realistic volume, duplicates, late events and malformed records. Simulate outages of producers and of BigQuery, and confirm that events are queued and replayed without loss. Write a runbook describing how to replay events, how to reconcile counts with the source and who to contact, so incidents are resolved calmly and quickly.

Add automated reconciliation that compares source counts with BigQuery counts per hour, and alert on differences beyond a threshold. This catches silent loss early, long before reports are affected.

  • Test duplicates, late events and bad records.
  • Simulate outages and replay.
  • Write a runbook.
  • Automate hourly reconciliation.

Common mistakes

  • Streaming data that could be batch loaded.
  • No unique ids, so duplicates cannot be removed.
  • Using arrival time instead of event time.
  • Ignoring quotas until production errors appear.
  • Not partitioning streaming tables.
  • No dead-letter route for invalid events.

A worked example

A payments company streamed transaction events through the Storage Write API into a table partitioned by event time and clustered by merchant. Each event carried a unique id, and a view removed duplicates. Invalid events went to a dead-letter table.

Fraud analysts saw activity within seconds, retries never produced double counts and ingestion cost stayed predictable because only critical events were streamed. The example is illustrative.

Best practices and support

  • Define freshness needs per use case.
  • Design for retries and duplicates.
  • Monitor lag, errors and cost.
  • Keep a batch path for backfills.

Our data warehousing service and system integration service build reliable streaming pipelines into BigQuery.

Read partitioning and clustering, change data capture, data observability and access control for related topics.

Streaming checklist

ItemDone when
NeedSeconds-level freshness justified
APIStorage Write API chosen where possible
KeysUnique event ids included
LayoutPartitioned and clustered
QualityDuplicates and bad records handled
OperationsQuotas, errors and cost monitored

Combining streaming and batch

A common design streams recent events for freshness and batch loads corrected or complete data later, then merges the two in a view or model. This gives low latency for operational use and accuracy for reporting. Document which table is the source of truth for each purpose, and how and when streamed data is reconciled with batch data.

  • Stream for freshness.
  • Batch for completeness and corrections.
  • Merge in a view or model.
  • Document the source of truth.

Monitoring streaming health

Track ingestion volume, error rates, latency from event to availability and the number of rows in dead-letter tables. Alert on drops in volume, which often signal a broken producer, and on sustained errors. Include a freshness check in dashboards so users know how current the data is.

  • Volume and error rate by table.
  • Event-to-availability latency.
  • Dead-letter row counts.
  • Freshness shown to users.

Security for streaming pipelines

Producers need permission to write only to the tables they use, so grant narrow roles to dedicated service accounts. Encrypt data in transit, avoid sending unneeded personal data and mask or tokenise sensitive fields before ingestion where possible. Review who can read streaming tables, since they often contain the most current and sensitive activity.

Key takeaways

  • Stream only when seconds matter.
  • Prefer the Storage Write API.
  • Design for duplicates and retries.
  • Partition by event time.
  • Monitor quotas, errors and cost.

Quick glossary

TermMeaning
Streaming insertReal-time write of rows
Storage Write APIHigh-throughput ingestion API
Event idUnique id for de-duplication
Dead-letter tableStore for invalid events
Streaming bufferTemporary write-optimised storage

Read next: BigQuery vs Snowflake: Which Cloud Data Platform? · BigQuery Access Control: IAM, Policy Tags and Row Security · BigQuery ML: Build Machine Learning Models With SQL

Frequently asked questions

What are BigQuery streaming inserts?

A way to write rows into BigQuery in near real time so they can be queried within seconds.

Which API should I use?

Prefer the Storage Write API for new pipelines, as it offers higher throughput, exactly-once options and lower cost.

How do I avoid duplicates?

Include a unique event id and de-duplicate downstream, as retries can produce duplicate rows.

Is streaming more expensive than batch loading?

Often yes, as streaming has ingestion charges while batch loading from files is usually free or low cost.

Can I query recently streamed data?

Yes, within seconds, though recent rows may not yet be fully optimised in storage.

How should I partition streaming tables?

By event time, and cluster by common filter columns.

What about bad records?

Send them to a dead-letter table for review instead of failing the pipeline.

When should I use batch loads instead?

When freshness of minutes or hours is enough, or when loading bulk or historical data.

Was this guide helpful?Your answer helps us decide what to improve. It is not linked to you.

#bigquery streaming inserts#bigquery storage write api#bigquery real time ingestion#bigquery streaming vs batch#bigquery streaming buffer

About the author

Arjun Mehta

Integration Architect

Arjun designs and builds integration architecture connecting CRM, ERP, and custom systems, with a specific focus on API-led connectivity patterns using MuleSoft.

Integration & APIs (MuleSoftREST/Bulk APIs)

Ready to put AI and data to work?

Book a free consultation and leave with a plan, not a pitch.

Get a free consultationRequest quote