Sharing data
Professional Data Engineer · Lesson 19 of 23 · 2:16:36
YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗
Learning with these videos? Subscribe for new courses and exam-style questions.
Subscribe on YouTube (opens in a new tab)In this lesson
Prepare for the Google Cloud Professional Data Engineer exam, on the official exam guide. In this lesson: rules for sharing curated data, BigQuery sharing (formerly Analytics Hub) with exchanges, listings, and linked datasets, data clean rooms, and publishing reports with Data Studio and datasets on a public exchange. Includes three original practice questions, with Cymbal Mobility, a fictional ride-hailing and scooter company, as the example.
Study notes
The text of this lesson, to read at your own pace. Information as of November 2026.
Three sharing requests
Partner cities want Cymbal Mobility's daily trip figures, and city councils want a dashboard of their own streets. An insurer also wants to know how many of its customers ride with Cymbal, without either side revealing its customer list. The data engineer must share each time, without losing control of the data.
Rules for sharing
Before sharing, define the rules: which data, for whom, at what level of detail, for how long, and under which agreement. Share curated views rather than raw tables, and keep column and row security on them. Prefer sharing in place to sending copies, so there is one version, access can be revoked, and usage can be measured. And involve the data owners and the legal team, because contracts and privacy laws decide what may leave the company.
BigQuery sharing
BigQuery sharing, formerly Analytics Hub, shares data without copying it. Publishers group listings in a data exchange, which is private by default, or public for every Google Cloud user. A listing points to a shared dataset, with tables, views, and models, or to a Pub/Sub topic, for streaming data. A subscriber gets a linked dataset in their own project, which is read-only, holds no copy, and is queried from that project. Publishers can restrict egress, so subscribers cannot copy, export, or snapshot the shared data, and they can follow usage metrics for each listing.
Data clean rooms
Data clean rooms let several parties join and analyze their data, without moving or revealing the underlying rows. A data contributor publishes views with analysis rules, like an aggregation threshold, so subscribers can analyze the data only through aggregation queries. Egress controls stop subscribers from copying or exporting raw data, and query templates can limit them to approved queries. Set analysis rules on views, because tables shared without rules give raw access.
Publishing reports and datasets
Reports bring data to people who never write SQL. In Data Studio, owner's credentials let viewers see the data without their own access to the dataset. Viewer's credentials make each viewer use their own access, so row-level security applies to each person. A service account can hold the credentials instead of a person, so a report does not depend on one employee's account. And to publish a dataset widely, use a listing in a public exchange, with documentation and a contact, so others can discover it and subscribe.
Recap
Let's recap. Define the rules first, share curated views, and prefer sharing in place to copies. BigQuery sharing publishes listings in private or public exchanges, and subscribers get read-only linked datasets. Egress restrictions stop subscribers from copying or exporting the data. Data clean rooms join data from several parties, with analysis rules that release only aggregates. And in Data Studio, viewer's credentials apply each person's own access, including row-level security.
Quick checks for this lesson
The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.
Twelve partner cities must receive Cymbal Mobility’s daily trip aggregates. Each city must always see the latest data, and must not be able to export it. What should the data engineer set up?
- A daily CSV export to a bucket for each city
- A listing in a public exchange for the partners
- A private exchange listing, with egress restricted
- A copy of the dataset in each city’s project
Show the answer
A private exchange listing, with egress restricted
A listing in a private exchange gives each city a linked dataset, always current, and egress restrictions block exports. “A daily CSV export to a bucket for each city” would send copies that the cities could forward anywhere. “A listing in a public exchange for the partners” would let every Google Cloud user find the data. And “A copy of the dataset in each city’s project” would create twelve copies, which drift apart and can be exported.
An insurer and Cymbal Mobility want to count their shared customers in each city, but neither side may see the other’s customer list. What should they use?
- A data clean room with analysis rules
- An authorized view shared with the insurer
- A linked dataset in each other’s project
- A file of hashed customer emails, swapped
Show the answer
A data clean room with analysis rules
In a data clean room, both sides contribute views with analysis rules, and only aggregated counts come out. “An authorized view shared with the insurer” would show the rows of the view to the insurer. “A linked dataset in each other’s project” would give each side read access to the other's rows. And “A file of hashed customer emails, swapped” would send identifiers outside any control, even when hashed.
City councils open a Data Studio report on a BigQuery table protected by row access policies. Each council must see only the rows of its own city. Which credentials should the data source use?
- Owner’s credentials, set by the report owner
- Service account credentials, with full access
- An extract of the table, refreshed daily
- Viewer’s credentials, for each council
Show the answer
Viewer’s credentials, for each council
With viewer's credentials, each council queries with its own access, so the row access policies apply to it. “Owner’s credentials, set by the report owner” would show every council the rows that the owner can see. “Service account credentials, with full access” would show all rows to everyone, through one account. And “An extract of the table, refreshed daily” would serve a copy, outside the policies of the table.