What you will be able to do
- Explain how a Unity Catalog connection and a foreign catalog combine to give governed, read-only access to an external system
- Choose between query federation and catalog federation, and name the sources each supports
- Create a connection whose credentials are stored as Databricks secrets, then create a foreign catalog from it
- Grant, revoke and audit connection privileges (CREATE FOREIGN CATALOG, USE CONNECTION) and table-level privileges on foreign catalogs
- Predict who can query a foreign catalog on dedicated, standard and serverless compute
Key concept
Connection (Unity Catalog securable) — A connection is a Unity Catalog object that holds the endpoint and the login credentials for an external database. Every foreign catalog built on it uses those credentials. Governing the connection therefore decides who can expose the external system in Databricks at all.
1.Two securables: the connection and the foreign catalog
Lakehouse Federation lets you query data that lives in another system without first copying it into Databricks. The docs describe it as the Databricks query federation platform, which gives governed, read-only access to external data through Unity Catalog foreign catalogs. Governance is the reason to use it instead of a quick JDBC read. Because the external data shows up as Unity Catalog objects, you get the same privilege model, lineage and search that you have for your own tables.
To make an external dataset queryable you create two objects. Both are securables, so both can be owned and granted on. The connection stores the path to the external system and the credentials for it. The foreign catalog is a mirror of one database in that system. It appears in the three-level namespace next to your normal catalogs.
This split puts credentials at the connection level. The secret is held in one place, the connection, and every foreign catalog that uses the connection reaches the external system with that identity. Users are never handed the database password. Instead you give them Unity Catalog privileges on the foreign catalog's tables. The foreign catalog is the securable that mirrors the external database so you can run read-only queries and control access with Unity Catalog.
A connection is also a different kind of object from the other credential-like objects in Unity Catalog. Storage credentials cover cloud object storage, and service credentials cover non-storage cloud services. A connection covers neither. It is the object for external systems such as databases.
Checkpoint 1 of 9· Check yourself
Which Unity Catalog object holds the path and credentials used to reach an external database, so that foreign catalogs do not need to store them?
The connection specifies the path and credentials for the external system. The foreign catalog only mirrors a database and refers to the connection by name.
“A connection is a securable object in Unity Catalog that specifies a path and credentials for accessing an external database system.”Source: docs.databricks.com
Every query against the foreign catalog reaches the external database with the connection's identity. That makes control over the connection the main security boundary. Who can use it, who can build catalogs on it, and who owns it are the questions that matter, and the rest of this lesson is about those privileges.
2.Query federation vs catalog federation, and the supported sources
Lakehouse Federation comes in two types, and the exam expects you to pick the right one for a scenario. Both are read-only, and both govern access through a foreign catalog with table-level controls. The difference is where the query runs.
With query federation, Unity Catalog pushes the query down to the external database over JDBC. The work is split between Databricks and the remote system's compute. With catalog federation, Databricks connects to an external catalog service and reads the table files directly from object storage. The query runs only on Databricks compute, so the docs call catalog federation more cost-effective and performance-optimized than query federation. Because catalog federation reads storage directly, it needs two more objects: a storage credential and an external location for the table paths.
| Aspect | Query federation | Catalog federation |
|---|---|---|
| Query path | Pushed down to the foreign database using JDBC; runs in Databricks and on remote compute | Reads the foreign table directly in object storage; runs only on Databricks compute |
| Typical use | Ad hoc reporting or proof-of-concept access to operational databases with minimal data movement | Incremental migration to Unity Catalog, or a long-term hybrid model with an external catalog |
| Extra setup beyond connection + foreign catalog | None | A storage credential and an external location for the table paths |
| Supported sources | MySQL, PostgreSQL, Teradata, Oracle, Amazon Redshift, Salesforce Data 360, Snowflake, Microsoft SQL Server, Azure Synapse (SQL Data Warehouse), Google BigQuery, Databricks | Legacy Databricks Hive metastore, External Hive metastore, AWS Glue metastore, Salesforce Data 360, Snowflake, Palantir Foundry |
| Write support | Not supported (read-only) | Not supported (read-only) |
Snowflake and Salesforce Data 360 appear in both lists, so the source system alone doesn't decide the type. Look at the pattern instead. Live JDBC pushdown means query federation. Reading the source's storage directly means catalog federation.
Federation also has limits. If you need to write to the external system, or your source isn't on these lists, the docs point you to the Spark Data Source API. When a source supports both federation and Lakeflow Connect, and performance on high data volumes or low latency matters, Databricks recommends Lakeflow Connect ingestion. Keep query federation for ad hoc reporting or proof-of-concept work.
Checkpoint 2 of 9· Put it in order
Put the query federation setup steps in the order the documentation gives them.
- 1.Run queries, which are pushed down to the external database
- 2.Grant privileges to users on tables in the foreign catalog
- 3.Create a foreign catalog using the connection
- 4.Create a connection in Unity Catalog with your access credentials and JDBC URL
A foreign catalog can only be built from an existing connection. Grants apply to the tables the foreign catalog exposes, and users can query only after they have those grants.
“Create a connection in Unity Catalog with your access credentials and JDBC URL. Create a foreign catalog using the connection.”Source: docs.databricks.com
Checkpoint 3 of 9· Exam question
A workspace admin runs the following statement to register an external PostgreSQL system in Unity Catalog: ```sql CREATE CONNECTION pg_orders TYPE postgresql OPTIONS ( host 'orders-db.internal', port '5432', user secret ('ops_scope', 'pg_user'), password secret ('ops_scope', 'pg_password') ); ``` A data engineer, who is not a metastore admin, needs to build a foreign catalog on top of `pg_orders` so downstream teams can query the tables as if they were native. Which combination of privileges must the engineer hold for the `CREATE FOREIGN CATALOG` statement to succeed?
Correct answer: A — `CREATE CATALOG` on the metastore, plus either ownership of `pg_orders` or a `CREATE FOREIGN CATALOG` grant on that connection.
- A. Creating a foreign catalog requires the general catalog-creation privilege at the metastore level, and separately requires a grant tying the caller to the specific connection: either owning that connection or holding `CREATE FOREIGN CATALOG` on it. Both conditions are enforced together.
- B. `USE CONNECTION` only authorizes reading the connection's details or having it referenced by a running pipeline; it does not carry the authority to mint a new catalog object from that connection.
- C. Owning the secret scope only controls who can reference the stored credential inside a `CREATE CONNECTION` statement; it has no bearing on Unity Catalog's separate authorization for catalog creation.
- D. `MODIFY` and `SELECT` are data-level privileges that apply to objects that already exist; neither one is the privilege Unity Catalog checks before allowing a new foreign catalog to be created.
3.Creating a connection with connection-level credentials
Several prerequisites apply before you create a connection.
- Workspace: it must be enabled for Unity Catalog. Workspaces created after November 8, 2023 are enabled automatically. - Cluster compute: Databricks Runtime 13.3 LTS or above, in Standard or Dedicated access mode. - SQL warehouses: pro or serverless, version 2023.40 or above. - Network: the compute must be able to reach the target database. - Privilege: you must be a metastore admin or hold CREATE CONNECTION on the metastore. In workspaces that were enabled for Unity Catalog automatically, workspace admins have CREATE CONNECTION by default.
You can create a connection in Catalog Explorer, with the CREATE CONNECTION SQL command, or through the REST API or CLI. In SQL, CREATE CONNECTION accepts these TYPE values: DATABRICKS, HTTP, MYSQL, POSTGRESQL, REDSHIFT, SNOWFLAKE, SQLDW, SQLSERVER. SaaS ingestion types can only be created in the UI or through the APIs. The options you supply depend on the connection type. PostgreSQL needs a host, port, user and password. Databricks recommends storing the sensitive values as Databricks secrets, not as plaintext strings.
CREATE CONNECTION <connection-name> TYPE postgresql
OPTIONS (
host '<hostname>',
port '<port>',
user secret ('<secret-scope>','<secret-key-user>'),
password secret ('<secret-scope>','<secret-key-password>')
)Some connection options control trust, not identity. On PostgreSQL the connection is always encrypted with SSL. If the server presents a certificate from a private certificate authority, you can pass its PEM-encoded certificate in userProvidedServerCertificate. This option is an alternative to trustServerCertificate, which skips verification, and it takes precedence when both are set.
Network access is a separate matter. The docs describe outbound security in two layers. Unity Catalog connections govern credentials and connection configuration such as the URL, host, port and options. Network policies govern which endpoints traffic can reach. A connection does not restrict network access at all.
Checkpoint 4 of 9· Check yourself
A security team says: "Because federated access goes through a governed Unity Catalog connection, compute can only reach hosts that have a connection defined." What is wrong with this?
The docs separate two layers. Connections handle credentials and settings, and network policies control traffic. A connection never acts as a network allowlist.
“Unity Catalog connections do not enforce network restrictions.”Source: docs.databricks.com
Checkpoint 5 of 9· Exam question
A metastore admin creates a connection to a Snowflake warehouse and wants three business analyst groups to be able to query different foreign catalogs built from that one connection, without any of the groups being able to see the underlying host, port, or credential values, and without any group being able to mint additional foreign catalogs beyond the ones the admin creates for them. Which grant strategy achieves this?
Correct answer: A — Grant `USE CONNECTION` on the connection to each group, then grant `USE CATALOG` plus `SELECT` on just the one foreign catalog assigned to that group.
- A. `USE CONNECTION` lets a principal query through catalogs that reference the connection without exposing the stored host, port, or secret values, and scoping `USE CATALOG`/`SELECT` to just one foreign catalog per group keeps each group limited to its assigned data without letting any group create new catalogs.
- B. Granting `CREATE FOREIGN CATALOG` would let every group independently create catalogs from the shared connection, which violates the requirement that only the admin controls how many foreign catalogs exist.
- C. `ALL PRIVILEGES` on the connection includes catalog-creation and ownership-transfer rights well beyond read access, and connection-level options such as the stored credential remain outside what any grant exposes to a non-owner querying through it, but the privilege scope here is far broader than required and risky to hand to three separate groups.
- D. Transferring `OWNER` hands full control of the connection, including the ability to alter its credentials and drop it, to a group member — a much larger blast radius than the read-only, catalog-scoped access the scenario calls for.
4.Creating the foreign catalog
If you create the connection in the Catalog Explorer UI, the wizard creates the foreign catalog in the same flow. It then asks which workspaces can access the catalog, who owns it, and which privilege presets to grant. All account users get BROWSE by default. Data Reader grants read privileges, and Data Editor grants read and modify privileges.
In SQL, creating the foreign catalog is a separate step and needs two privileges:
1. CREATE CATALOG on the metastore. 2. Either ownership of the connection or the CREATE FOREIGN CATALOG privilege on the connection.
The statement names the connection with USING CONNECTION and names the external database in OPTIONS. MySQL is the exception: it uses a two-layer namespace, so you don't supply a database. The statement never includes credentials, because they come from the connection. Foreign catalog metadata is synced into Unity Catalog on each interaction with the catalog, so the mirror stays current without a scheduled refresh.
Checkpoint 6 of 9· Fill the gap
Which keyword completes this statement so that the foreign catalog takes its path and credentials from an existing securable?
CREATE FOREIGN CATALOG [IF NOT EXISTS] <catalog-name> USING ? <connection-name>
OPTIONS (database '<database-name>');A foreign catalog is always built from a connection. Storage credentials and external locations are extra objects for catalog federation, not the thing CREATE FOREIGN CATALOG binds to.
Source: docs.databricks.comSources1
5.Governing access: connection privileges and table-level grants
Governance works at two levels. Connection-level privileges decide who can build on the connection or use it. Table-level privileges on the foreign catalog decide who can read the mirrored data.
The connection has two privileges you can grant:
- CREATE FOREIGN CATALOG lets a user create a foreign catalog that is a read-only mirror of a database in the connection's data source. - USE CONNECTION lets a user use the connection in Lakeflow pipelines to ingest data from the source into Databricks.
USE CONNECTION behaves differently at the metastore level. Granted on the metastore, it only lets the user view the details of connections. To actually use a connection, the user still needs USE CONNECTION on that specific connection.
Only a metastore admin or the connection owner can grant or revoke these privileges. Only the connection owner can drop the connection.
GRANT CREATE FOREIGN CATALOG ON CONNECTION <connection-name> TO <user-name>;You can inspect connections with SHOW CONNECTIONS [LIKE <pattern>]; and DESCRIBE CONNECTION <connection-name>;. Which connections you see depends on your privileges. Users with USE CONNECTION on the metastore see all of them. Everyone else sees only the connections they own or hold some privilege on. To revoke a privilege, run REVOKE <privilege> ON CONNECTION <connection-name> FROM <user-name>;. To remove a connection, run DROP CONNECTION [IF EXISTS] <connection-name>;.
Checkpoint 7 of 9· Match them up
Match each privilege to what it permits.
Tap a term, then the definition that fits it.
The metastore-level USE CONNECTION is the one candidates confuse. It allows viewing connection details only. Using a connection requires USE CONNECTION on that connection.
“However, if granted at the metastore level, it only allows viewing the details of connections in the metastore.”Source: docs.databricks.com
Once the foreign catalog exists, you treat it like any other catalog. You grant read-only access to foreign tables with standard Unity Catalog privileges, and Databricks tracks lineage for them the same way it does for standard tables. Queries must use Apache Spark data types.
The access mode of the compute changes who can query. On standard access mode and serverless compute, the standard catalog privileges apply. On dedicated access mode compute, the user must own the underlying connection to query the foreign catalog. Holding CREATE FOREIGN CATALOG on the connection is not enough.
Checkpoint 8 of 9· Check yourself
An analyst has CREATE FOREIGN CATALOG on a connection and SELECT on the foreign catalog's tables, but does not own the connection. Their query fails on a dedicated access mode cluster. Which change lets them query?
On dedicated access mode, querying requires ownership of the connection. On standard access mode and serverless compute, the analyst's normal catalog privileges are enough.
“On dedicated access mode compute, you must own the underlying connection to query data in the foreign catalog.”Source: docs.databricks.com
Checkpoint 9 of 9· Exam question
A data engineering team is deciding between Lakehouse Federation's query federation model and its catalog federation model for a new integration with an external Hive Metastore that already stores large Parquet tables in cloud object storage. Which statements correctly describe how these two models differ? (choose 2)(Select 2)
Correct answers: A, B — Query federation splits execution between Databricks and the remote system over a JDBC-style connection, which suits ad hoc reporting and BI against operational databases.; Catalog federation reads the underlying object storage directly using Databricks compute, avoiding re-execution against the source engine, and can incrementally replace that source during a Unity Catalog migration.
- A. Query federation pushes work to the remote database through a JDBC-style connection and splits execution between the two systems, which fits ad hoc reporting and BI use cases against operational databases well.
- B. Catalog federation lets Databricks compute query the object storage directly rather than routing through the source engine, giving better performance and letting a team migrate onto Unity Catalog gradually while still reading the legacy metastore's tables.
- C. Query federation connects to the source system's native format through JDBC without requiring a prior migration to Delta Lake; the source stays exactly as it is in its own database engine.
- D. Catalog federation targets batch object-storage catalogs such as an external Hive Metastore, AWS Glue, or Iceberg tables, not streaming message-bus sources, which are handled through Auto Loader or Lakeflow ingestion instead.
- E. In catalog federation, Databricks compute executes the query directly against the object storage rather than delegating execution to the source system, so the source engine is not the sole execution path in either model.
Exam traps
Each one states something that sounds right. Open it to see what is actually true.
1.Granting USE CONNECTION on the metastore lets a user use every connection in it.Why is that wrong?
At the metastore level, USE CONNECTION only allows viewing connection details. The user still needs USE CONNECTION on each individual connection to use it.
Covered in Governing access: connection privileges and table-level grants
2.Anyone with CREATE FOREIGN CATALOG on a connection can query the resulting foreign catalog on any compute.Why is that wrong?
On dedicated access mode compute, only the connection owner can query the foreign catalog. Standard catalog privileges are enough only on standard access mode and serverless compute.
Covered in Governing access: connection privileges and table-level grants
3.Lakehouse Federation can write back to the external database through the foreign catalog.Why is that wrong?
Both query federation and catalog federation are read-only. For write access, the docs point to the Spark Data Source API.
Covered in Query federation vs catalog federation, and the supported sources
4.Defining a Unity Catalog connection also restricts which external hosts compute can reach.Why is that wrong?
Connections govern credentials and configuration only. Network policies control allowed traffic.
Covered in Creating a connection with connection-level credentials
Sources
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“A foreign catalog, a securable object in Unity Catalog that mirrors a database in an external data system”
↩︎ Two securables: the connection and the foreign catalog“choose query federation for ad hoc reporting or proof-of-concept work on your ETL pipelines”
↩︎ Query federation vs catalog federation, and the supported sources“We recommend that you use Databricks secrets instead of plaintext strings for sensitive values like credentials.”
↩︎ Creating a connection with connection-level credentials“you must be a metastore admin or a user with the CREATE CONNECTION privilege on the Unity Catalog metastore”
↩︎ Creating a connection with connection-level credentials“Databricks compute must use Databricks Runtime 13.3 LTS or above and Standard or Dedicated access mode.”
↩︎ Creating a connection with connection-level credentials“Permissions required: CREATE CATALOG permission on the metastore and either ownership of the connection or the CREATE FOREIGN CATALOG privilege on the connection.”
↩︎ Creating the foreign catalog“Foreign catalog metadata is synced into Unity Catalog on each interaction with the catalog.”
↩︎ Creating the foreign catalog“Not required for MySQL, which uses a two-layer namespace.”
↩︎ Creating the foreign catalog“Access credentials for the foreign catalog come from the named connection, so you don't specify them here.”
↩︎ Prediction - 2.https://docs.databricks.com/aws/en/query-federationOfficial docs
“It provides governed, read-only access to external data through Unity Catalog foreign catalogs”
↩︎ Two securables: the connection and the foreign catalog“The query is only run on Databricks compute, meaning that catalog federation is more cost-effective and performance-optimized than query federation.”
↩︎ Query federation vs catalog federation, and the supported sources“Create a storage credential and an external location for the table paths.”
↩︎ Query federation vs catalog federation, and the supported sources“Use it when Lakehouse Federation doesn't support your source, when you need write access”
↩︎ Exam trap 3“Create a connection in Unity Catalog with your access credentials and JDBC URL. Create a foreign catalog using the connection.”
↩︎ Checkpoint - 3.
“Connections are not the same as storage credentials (for cloud object storage) or service credentials (for non-storage cloud services).”
↩︎ Two securables: the connection and the foreign catalog“The SQL CREATE CONNECTION statement supports the following TYPE values: DATABRICKS, HTTP, MYSQL, POSTGRESQL, REDSHIFT, SNOWFLAKE, SQLDW, SQLSERVER.”
↩︎ Creating a connection with connection-level credentials“Unity Catalog connections do not enforce network restrictions.”
↩︎ Exam trap 4“Unity Catalog connections do not enforce network restrictions.”
↩︎ Checkpoint - 4.
“This option is an alternative to trustServerCertificate and takes precedence over it.”
↩︎ Creating a connection with connection-level credentials - 5.
“USE CONNECTION grants the ability to use the connection in Lakeflow pipelines to ingest data from the data source into Databricks.”
↩︎ Governing access: connection privileges and table-level grants“Users with the USE CONNECTION privilege on the metastore see all connections.”
↩︎ Governing access: connection privileges and table-level grants“A connection is a securable object in Unity Catalog that specifies a path and credentials for accessing an external database system.”
↩︎ Key concept“However, if granted at the metastore level, it only allows viewing the details of connections in the metastore.”
↩︎ Exam trap 1“A connection is a securable object in Unity Catalog that specifies a path and credentials for accessing an external database system.”
↩︎ Checkpoint“However, if granted at the metastore level, it only allows viewing the details of connections in the metastore.”
↩︎ Checkpoint - 6.
“You grant read-only access to foreign tables using standard Unity Catalog privileges.”
↩︎ Governing access: connection privileges and table-level grants“On standard access mode and serverless compute, standard catalog privileges apply.”
↩︎ Governing access: connection privileges and table-level grants“The CREATE FOREIGN CATALOG privilege on the connection isn't sufficient.”
↩︎ Exam trap 2“On dedicated access mode compute, you must own the underlying connection to query data in the foreign catalog.”
↩︎ Checkpoint