Skip to main content
← Back to Patterns

Publish a BigQuery dataset without sponsoring every reader's queries

By Ivan Richter LinkedIn

Last updated:

6 min read

In brief

Publish a BigQuery dataset when readers need SQL and have their own execution project. Offer versioned downloads for readers who just need the data.

  • Put approved releases in a dedicated public dataset.
  • Verify that readers run queries in their project while the publisher pays for storage.
On this page

Making analytical data public doesn’t require offering strangers an unlimited query budget. BigQuery can separate the project that stores a dataset from the project that runs a reader’s query. That helps when the audience wants to join or selectively query a dataset too large to download casually.

For a monthly extract that most readers will open locally, we’d publish a versioned file first. We’d add public BigQuery access when readers benefit enough from SQL to use their own Google Cloud project.

The publisher pays to prepare and store the release. Each reader brings their own execution project. A public endpoint that submits arbitrary SQL through our service account would make a different promise, including paying for the work it accepts.

All of this assumes the data is already approved for public copying and use. No billing arrangement can make confidential data suitable for publication.

If access must depend on a customer relationship or an agreement with a named recipient, keep a controlled sharing model.

Decide what the reader must bring

BigQuery’s documented public-sharing route grants a dataset read access to allAuthenticatedUsers. That principal covers personal Google accounts and service accounts outside the publisher’s organization too. It excludes anonymous visitors.

In IAM’s definition, authenticated only means the caller signed in with a Google identity, not that we approved them.

Readers still need a project where they can create BigQuery jobs. Some usage fits the free tier without a billing account, but the project, authentication, and usage limits remain.

That suits an analyst already using BigQuery. For a researcher who wants one small file, it’s a substantial barrier. Choose the delivery method for the reader’s task.

A static download still has costs. On Cloud Storage, the owner normally pays for requests and network use as well as storage. Requester Pays can move eligible request costs to a reader’s billing project, but that brings back the cloud-project requirement. For account-free downloads, budget for the distribution service and the expected traffic.

Keep public releases away from working data

We’d put approved physical release tables in a dedicated dataset, preferably in a project whose purpose is public distribution. Private preparation, failed candidates, and diagnostic tables stay elsewhere. Dataset-level Data Viewer access applies to tables added there later. Every future write into that dataset is a publication action.

A physical release table gives readers a stable dependency on reviewed output. A view over live internal models can suit public data that’s meant to stay current. It also carries those models’ availability and definition changes into the public contract.

For a periodic release, we’d pay for the separate stored result and keep internal refactors out of the reader’s query path.

Suppose a publisher releases monthly vehicle counts by area as civic-data-public.transport_2026_09_v1.daily_counts, in EU, with one row per service_date and area_code. The table name can’t tell a reader whether an absent row means zero vehicles or a missing observation. Put the date range, area definitions, count unit, and treatment of missing observations in the release documentation.

Keep a manifest with the release identifier, exact table name, location, schema, row count, covered period, source revision, usage terms, and correction contact. For downloadable files, wait until the export completes, then list the exported objects with their sizes and checksums. The number of output files can vary. Check the chosen format as well: CSV can’t represent nested or repeated fields directly.

A writer with the required permissions can still overwrite a versioned table. Restrict the release writer and stop routine jobs from replacing old releases.

Publish a corrected version with an explanation of what changed. Record the supported lifetime and check that the table’s expiration agrees with it. A current-version alias can help discovery, but reproducible analysis should cite the fixed release it read.

Grant public reading at the release boundary

Inspect the dataset and project policies before making the change. Domain-restricted sharing can block public principals. If public distribution is intended, work out a release-specific exception with the organization administrator. Removing the organization’s restriction wholesale to make one grant succeed would expand this decision to unrelated data.

For the dedicated example dataset, the public read grant is:

GRANT `roles/bigquery.dataViewer`
ON SCHEMA `civic-data-public`.transport_2026_09_v1
TO "specialGroup:allAuthenticatedUsers";

Run it only after reviewing every object in that dataset and the inherited access above it. The executor needs permission to create the SQL job and to update the dataset’s access. Give public readers no writer role and no project role that lets them submit jobs against the publisher’s query budget.

A reader might run this query through a separate project such as reader-research, with processing location EU:

SELECT area_code, SUM(vehicle_count) AS vehicle_count
FROM `civic-data-public.transport_2026_09_v1.daily_counts`
WHERE service_date >= DATE '2026-09-01'
  AND service_date < DATE '2026-10-01'
GROUP BY area_code;

The table name identifies the publisher’s data, while the execution project set in the client or query editor identifies who runs the job. With on-demand pricing, that project receives the query charge. Under capacity pricing, the reservation’s administration project is billed. Storage stays with the publisher either way. The resource hierarchy’s billing rules apply to public datasets too.

The publisher still pays for its own preparation queries, refresh jobs, the older versions it keeps, and any download distribution it offers separately. Model those costs from size and frequency.

Verify the release from outside the publisher’s privileges

Before advertising access, test with an authorized identity that has no special role in the publisher project. Give it an independent execution project.

Start with a dry run of the documented sample. Then run a bounded query and inspect its project, location, and expected result. A publisher administrator testing their own table won’t notice a missing public grant or an accidental dependence on internal permissions.

Check that the same reader can’t change the release, read a private candidate dataset, or create jobs in the publisher project. Review policy inheritance as well as the specific dataset binding. Keep the resulting query-job reference with the release check so anyone can confirm which project ran the job.

Public IAM doesn’t override service perimeters. Readers whose organizations use them may need their administrators to allow access to public data.

For a download, fetch the published object through the intended public path and compare its checksum with the manifest. Then open it with the kind of parser an ordinary reader would use and check that the types come through intact.

Discovery doesn’t transfer the publishing bill

Making a dataset public doesn’t enroll it in Google’s Public Dataset Program. Google covers storage for datasets hosted through that program. A dataset published in our own project keeps its storage charges there. Onboarding is a separate process, with a contact on the Google Cloud datasets page.

BigQuery sharing, formerly Analytics Hub, adds listings, discovery, and subscriptions. Its linked datasets let consumers access shared resources without a separate stored copy. That can justify the extra publishing setup when readers need a catalog or a managed subscription experience.

The documented pricing still assigns dataset storage to the publisher and query use to subscribers. For a small public release with a known landing page, a fully qualified table name and clear instructions may be enough.

Withdraw access without promising recall

For an ordinary correction, publish the replacement and mark the old version’s status in the release record. Keep the old version for the stated support period when continued access is appropriate. Don’t replace its rows under a release identifier that citations already use.

If the release must stop being publicly readable, remove its public grant and check for other public bindings or inherited access:

REVOKE `roles/bigquery.dataViewer`
ON SCHEMA `civic-data-public`.transport_2026_09_v1
FROM "specialGroup:allAuthenticatedUsers";

Retest after the access change takes effect. Update the landing page and withdraw any downloadable artifacts or listings that still distribute the same release. Record the affected version and the reason without repeating sensitive contents in the correction notice.

Readers may already have copied the data, and changing our permissions can’t remove those copies. If that’s unacceptable, the dataset needs a different distribution agreement before it becomes public.

More in this domain: Data

Browse all

Related patterns