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.

Ingestion options compared
| Option | Latency | Cost profile | Notes |
|---|---|---|---|
| Batch load from files | Minutes to hours | Low or no ingestion charge | Best for periodic loads |
| Storage Write API, default stream | Seconds | Lower than legacy streaming, with free allowances | At-least-once, simple to adopt |
| Storage Write API, committed or pending streams | Seconds or on commit | Same family of pricing | Exactly-once semantics and transactional batch commits |
| Legacy insertAll API | Seconds | Higher per volume | Simple, best-effort de-duplication |
| Pub/Sub or Dataflow into BigQuery | Seconds | Service plus ingestion charges | Managed pipeline with transformations |
| Change data capture connectors | Seconds to minutes | Connector plus ingestion | Replicate 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.

Designing a streaming pipeline
- Define the event. Choose schema, keys and timestamps.
- Choose the API. Prefer the Storage Write API for new pipelines.
- Add unique ids. Include an event id so duplicates can be detected.
- Handle retries. Retry safely and expect duplicates.
- Partition the table. Partition by event time and cluster by common filters.
- Monitor. Track errors, latency, quotas and cost.
Duplicates, ordering and late data
| Issue | Cause | Approach |
|---|---|---|
| Duplicates | Retries and at-least-once delivery | Use event ids and de-duplicate in a view or model |
| Out-of-order events | Network and producer delays | Use event time, not arrival time, for logic |
| Late arrivals | Mobile or batch producers | Allow a window and reprocess recent partitions |
| Schema drift | Producers add fields | Version schemas and allow additive changes |
| Bad records | Invalid data | Route 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.
Related guides
Read partitioning and clustering, change data capture, data observability and access control for related topics.
Streaming checklist
| Item | Done when |
|---|---|
| Need | Seconds-level freshness justified |
| API | Storage Write API chosen where possible |
| Keys | Unique event ids included |
| Layout | Partitioned and clustered |
| Quality | Duplicates and bad records handled |
| Operations | Quotas, 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
| Term | Meaning |
|---|---|
| Streaming insert | Real-time write of rows |
| Storage Write API | High-throughput ingestion API |
| Event id | Unique id for de-duplication |
| Dead-letter table | Store for invalid events |
| Streaming buffer | Temporary 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.
