When cold history should stay in BigQuery
In brief
Keep cold history in BigQuery when retrieval costs would outweigh the storage savings.
- Include retrieval time and labor in the cost of an archive.
- Restore the archive and reproduce a historical answer before retiring the source table.
Suppose an old orders table hasn’t appeared in a dashboard for six months. Archiving it may cut its storage charge. But when someone asks for a historical product-category comparison, the person answering still needs the right schema, reference data, permissions, and a queryable result.
We’d keep cold history in BigQuery when the storage saving is modest and future questions are unpredictable. Archive it when the data is large enough to justify the work, rarely needed, and recoverable within an agreed deadline. The decision depends on the cost of the next correct answer as well as the cost of keeping bytes.
First check why you’re keeping the data. If nobody needs it and no retention obligation applies, a cheaper place to keep it forever only postpones deleting it.
Compare against the warehouse bill you could keep
An unchanged historical table may already receive BigQuery’s long-term storage rate. BigQuery applies the 90-day condition to each partition separately. Queries and exports don’t restart that clock. Long-term data doesn’t get slower to query either. Occasional historical analysis can run against it at the long-term rate.
Take the keep-in-BigQuery cost from the current bill and billing model, including compression, retained versions, and regional rates. Price long-term and physical storage before exporting anything for archival.
Don’t compare an unoptimized active logical-storage estimate with the smallest compressed object-storage estimate and call the entire difference a saving.
Why do old partitions still change? A full rebuild can keep rewriting history that could otherwise stay stable. Repairing that workload may reduce cost while keeping immediate SQL access. It can also be the wrong change if legitimate historical corrections are common. Archiving shouldn’t block corrections the business still needs.
The unit you archive can be a closed year or an obsolete source generation rather than an entire dataset. Keep the current period and frequently compared history queryable while you evaluate older slices separately. Preserve the joins those slices need. An archived fact table whose historical reference records were later deleted can be harder to use than its byte count suggests.
Cloud Storage Archive is online, but retrieval still has work
Cloud Storage’s Archive class provides online, low-latency object access, with no offline thaw before bytes can be read. The delay to an analytical answer comes from the access and reconstruction process you build around those objects, including any load, conversion, and verification.
The class also changes the charging model. Nearline, Coldline, and Archive have minimum storage durations of 30, 90, and 365 days respectively. Deleting or replacing an object early can add charges for the rest of the minimum period.
For fixed storage classes, reads can also bring retrieval, operations, and network charges. Price the configuration you intend to use: Autoclass and lifecycle transitions have their own exceptions.
Count the exported object size along with any versioning and protection settings. Object Versioning keeps older versions as separately charged objects. Soft-deleted objects still count as billed storage. A cleanup can succeed and still leave billed copies behind.
BigQuery can also query external tables backed by Cloud Storage. For a rare, simple question, that can avoid a native-table load. The route still needs a usable schema, source access, and a compatible location, and it doesn’t promise native-table performance. Include the bytes it reads and their storage-class charges when you compare it.
Let retrieval frequency reverse the saving
Use an annual model that includes storage, routine archive verification, and the annualized cost of setting up the archive process. Then add the incremental work for each historical request. Compare the same content, retention period, and acceptable answer, without counting query work common to both options twice.
Suppose, with made-up planning numbers, that keeping the data in BigQuery costs $600 per year. The archive’s fixed annual cost is $240 once its storage and allocated setup and verification work are included. Each retrieval adds $180. That’s two hours of engineering at $75 per hour, plus $30 of incremental service costs.
With one retrieval, the archive costs $420 for the year. Two retrievals bring it to $600, the same as keeping the table. Four bring it to $960.
Automating the reconstruction so a request needs little intervention changes those numbers. If a request interrupts someone who no longer remembers the schema, two hours may be optimistic.
A request due during an ongoing incident can’t wait for the only engineer who understands the archive. A scheduled annual review with a retrieval procedure already in place gives the team time to prepare a bounded slice. Price each request by its real deadline instead of treating every request as either immediate or theoretical.
For a large immutable dataset, the storage difference may comfortably fund a tested archive process. We’d choose archival in that case. For a small table, keeping ordinary SQL access can cost less than maintaining another recovery procedure.
Archive enough information to reconstruct the answer
Treat each archive release as a fixed package with a version and a known source cutoff.
Record the source table and location, extraction job, scope, format, and compression. Keep the schema and the table settings needed for reconstruction, including partitioning, clustering, and the access design. A table data export doesn’t carry that configuration.
Keep the transformation or definition that explains the archived columns. If an amount is in minor units or an order status uses a historical code list, keep that meaning with the package. A future reader shouldn’t need the retired application to decode it.
Related tables can be separate exports, but the package should identify which versions belong together.
Choose a format by testing its return path. BigQuery can export nested and repeated data to Avro and Parquet. CSV can’t represent those structures. Even the schema-bearing formats leave some conversion issues.
An Avro export of a BigQuery DATETIME, for example, becomes a string representation that won’t automatically reload as DATETIME. Avro logical-type handling doesn’t cover that round trip. Reloading that column may take a tested staging load followed by a cast.
Keep the exact conversion procedure and test boundary values, including nulls and fractional seconds. Check the restored type as well as load success.
Use a new destination prefix for each export attempt and finalize a manifest of its objects only after the job succeeds.
The EXPORT DATA overwrite option replaces matching object names but leaves old unmatched shards in place. Reusing a prefix and later loading everything under its wildcard can mix two exports.
For each finalized object, record its name, generation, size, and checksum. That record catches missing or changed files. To check the business rows, also keep row counts and key or amount controls for the source cutoff.
Check the export path against the archive protections you need, because retention policies can interfere with export file rewrites. A locked bucket retention policy can’t be disabled or reduced, so use a compatible staging-and-finalization design where necessary.
Prove the return path before removing the table
Restore a representative archive package into a separately named, restricted dataset while the source is still available for comparison. Use the recorded schema and conversion steps. Then compare types, row counts, and business controls. Include a real historical query that the archived data is supposed to support.
Measure elapsed time and the interventions required. Record the operator identity, location, permissions, and any temporary resources the process needs.
Repeat the test with a missing shard or an altered file to show that the procedure rejects an incomplete package.
Keep the native table until the archive release and retrieval procedure have passed those checks and its consumers have an accepted replacement path. Then remove only the reviewed historical scope through the normal retention change process.
Keep the archive catalog discoverable, with the retrieval owner and expected turnaround. Revisit the decision when historical requests become frequent enough that repeated restoration is now the expensive option.
More in this domain: Data
Browse allBigQuery global queries or a local serving copy?
A global BigQuery query can suit occasional selective reads. An approved local copy can save transfers when reports repeatedly read the same remote data.
Use BigQuery clones for bounded development work
Use a writable BigQuery clone when a test needs the source data's distribution or history. Use a small fixture when it reproduces the problem.
When external Parquet deserves a native BigQuery copy
Keep Parquet external for occasional reads. A native BigQuery copy can pay off when reports repeatedly scan the same files.
Publish a BigQuery dataset without sponsoring every reader's queries
Publish a BigQuery dataset when readers need SQL and have their own execution project. Offer versioned downloads for readers who just need the data.
When selective lookups can stay in BigQuery
Try a BigQuery search index for occasional, selective lookups on data already in the warehouse.
Related patterns
BigQuery physical vs. logical storage: compare the full bill
Physical billing rewards compression, but retained versions can consume the savings. Compare both models using the dataset's current data, rewrite history, and recovery requirements.
BigQuery tenant access starts with the query identity
Choose tenant isolation from the identity BigQuery sees on the report's query.
On-demand vs slots: the SME decision boundary
Start an SME warehouse on BigQuery on-demand pricing. Consider reservations when recurring workloads need predictable capacity or interfere with one another.
Publish related BigQuery tables as one consistent release
Publish related BigQuery tables in one DML transaction when the change fits. Use immutable releases when readers need consistency across separate queries.