cancel
Showing results for 
Search instead for 
Did you mean: 
Technical Blog
Explore in-depth articles, tutorials, and insights on data analytics and machine learning in the Databricks Technical Blog. Stay updated on industry trends, best practices, and advanced techniques.
cancel
Showing results for 
Search instead for 
Did you mean: 
victorgomess
Databricks Employee
Databricks Employee

Introduction

Cloud Storage sits under almost everything you build on Databricks on Google Cloud. Unity Catalog stores managed tables and volumes in the GCS buckets you assign as managed storage for a metastore, catalog or schema, and external locations point at buckets you already own. How your compute reaches those buckets is a security question as much as a networking one.

Databricks gives you two kinds of compute to read and process that data. Serverless compute runs in projects that Databricks manages. It starts in seconds, scales on its own and leaves no clusters for you to size or patch, and it is the option we recommend. Classic compute runs clusters in a VPC network in your own Google Cloud project, which gives you full control of the network around them.

The two connect to GCS in different ways, so this post covers them separately, starting with serverless. For each method you will find when to use it and what it costs you in effort, plus a link to a short implementation guide with the console steps, CLI commands and screenshots for that method only. We tested every method end to end in a lab in us-east4.

One thing comes first: register the bucket in Unity Catalog with a storage credential and an external location (guide). Every method below reads data that way.

Serverless compute

Serverless runs outside your VPC, so the Cloud NAT, DNS zones and PSC endpoints in your project do not affect it. Its network settings live in the Databricks account console, in network connectivity configurations, or NCCs (serverless networking).

How serverless reaches a bucket

How serverless reaches a bucket: the default path, or a dedicated endpoint that a perimeter can allow.

Options

Method How it works Use it when Pros Cons
1. Default path Serverless reaches GCS over Google's network through Private Google Access, from Databricks-managed projects The bucket's project is not in a VPC Service Controls perimeter Nothing to set up and no extra cost Cannot be limited to your account in a perimeter: the source projects are shared by every Databricks customer in the region
2. NCC private endpoint (Beta) Databricks creates a Private Service Connect endpoint to Cloud Storage just for your account The bucket is in a perimeter, or your policy asks for a dedicated private path One stable source you can allow in a perimeter, managed from the account console Beta and Enterprise plan only; up to 10 private endpoints per region; no Terraform support yet

Method 1: default path

Serverless already reaches Cloud Storage over Google's network through Private Google Access, the built-in, no-cost way for machines without external IPs to reach Google APIs. If IAM and Unity Catalog are how you protect the bucket, there is nothing to configure beyond the storage credential.

Serverless reads a bucket with nothing configured

Method 1 in our lab: serverless lists and reads a bucket with nothing configured.

The catch is VPC Service Controls. Serverless calls come from Databricks-managed projects that are shared by every Databricks customer in the region, so you cannot write a perimeter rule that admits only your account. Most customers want to allow only endpoints tied to their own account or workspace. That is what method 2 is for.

Method 2: NCC private endpoint (Beta)

You add a private endpoint rule for Cloud Storage to an NCC in the workspace region, and Databricks creates a Private Service Connect endpoint for your account. You allow that endpoint in your perimeter, enable the rule and attach the NCC to the workspace. From then on, serverless reads the protected bucket through a path that belongs to you. You need the Enterprise plan. Implementation guide: Serverless: private endpoint to Cloud Storage. Databricks documentation: Configure private connectivity to Google APIs.

NCC private endpoint rule for Cloud Storage, ESTABLISHED

Method 2 in our lab: the NCC private endpoint rule for Cloud Storage is ESTABLISHED.

Classic compute

Classic clusters run in your workspace VPC, so the route to Cloud Storage is yours to design.

How a classic cluster reaches a bucket

How a classic cluster reaches a bucket with each method. Non-Google traffic goes out through Cloud NAT.

Options

Method How it works Use it when Pros Cons
1. Cloud NAT NAT gives the cluster internet access. Google API traffic never goes through it and stays on Google's network IAM and Unity Catalog are enough protection Simplest setup, and you need NAT anyway for PyPI and similar Uses the public Google API endpoints and the cluster can reach any Google API, including buckets outside your organization; the bucket stays reachable from the internet with valid credentials unless you add a perimeter
2. Private Google Access + restricted VIP Private DNS sends every Google API to restricted.googleapis.com, a Google virtual IP (VIP) range that only serves APIs VPC Service Controls can protect You want to limit Google API access, or you are planning a perimeter Blocks exfiltration to other Google services; no endpoints to run DNS, routes and firewall rules to maintain; unsupported Google APIs stop working
3. PSC endpoint for Google APIs storage.googleapis.com resolves to a private IP in your VPC Your network team wants Google API traffic on a private IP they own, or servers in your data center must reach Cloud Storage over VPN or Interconnect Private IP you control, reachable over VPN and Interconnect One endpoint and DNS record per VPC; Google charges per endpoint

Method 1: Cloud NAT

Most workspaces start here. Cloud NAT gives clusters internet access for things like PyPI, but Google API traffic never goes through it, because Google turns on Private Google Access for every subnet NAT covers. Implementation guide: Classic: Cloud NAT.

Method 2: Private Google Access with the restricted VIP

Google publishes restricted.googleapis.com, a virtual IP range (VIP, 199.36.153.4/30) that only serves the Google APIs VPC Service Controls can protect. A private Cloud DNS zone sends every googleapis.com name to that VIP, so the cluster cannot reach other Google APIs. You add two routes and, if you want to go further, a deny-all egress rule with a few exceptions. This is the usual base for a perimeter. Implementation guide: Classic: Private Google Access with the restricted VIP.

Method 3: PSC endpoint for Google APIs

If your network team wants Google API traffic on an IP address they own, create a Private Service Connect endpoint with the vpc-sc bundle and point storage.googleapis.com at it. The same endpoint is reachable from on-premises over VPN or Interconnect. Implementation guide: Classic: PSC endpoint for Google APIs.

Locking it down with VPC Service Controls

A private path keeps traffic off the internet, but it does not stop someone with valid credentials from reading the bucket from somewhere else. A VPC Service Controls perimeter around the data project does. Start it in dry-run mode, look at what it would block, and add an ingress rule for each Databricks source: the workspace project for classic clusters, the Databricks control plane projects for your region (Unity Catalog uses them to check external locations), and the NCC endpoint for serverless. Once the logs are clean, enforce it. Implementation guide: Lock it down: VPC Service Controls around the bucket.

Conclusion

Databricks gives you several ways to reach your data on Google Cloud, from a default that works out of the box to dedicated private endpoints behind a service perimeter. You can start simple and tighten things as your requirements grow, without changing how your teams work with data in Unity Catalog.

Start with serverless, add a private path and a perimeter where your policies call for them, and you have a lakehouse your data teams can move fast on and your security team can sign off on. We hope these guides help you get there.

Tags: Databricks on Google Cloud, Cloud Storage, Serverless, VPC Service Controls, Private Service Connect, Unity Catalog

1 Comment
LucasPorto
Databricks Employee
Databricks Employee

Thanks for sharing this one, Victor!