Sub topic 2
What Databricks Provides
This chapter gives you the working model of the platform: what Databricks contains and how the parts relate. It assumes you know basic SQL, some Python, and the difference between a data lake and a data warehouse. You should also know what cloud object storage and virtual machines are. Later chapters cover each part in detail.
The platform in one picture
Databricks is a cloud data and AI platform built on the lakehouse idea. A lakehouse keeps data in open file formats on cloud object storage, then adds warehouse features on top: ACID transactions, SQL, and access control. You work with one copy of the data instead of a lake plus a separate warehouse.
The platform is a set of layers. Each layer has one job.
What each piece does
| Piece | What it provides |
|---|---|
| Workspace | The web environment where you find notebooks, queries, jobs, and data. |
| Compute | The machines that run your code: clusters, SQL warehouses, and serverless options. |
| Apache Spark | The distributed engine that processes data in parallel across machines. |
| Delta Lake | A table format with a transaction log, giving reliable tables on open storage. |
| Unity Catalog | Central governance: names, permissions, and auditing for data. |
| Jobs | Scheduled or triggered runs of notebooks and other code. |
Two points about this table matter in practice. First, storage and compute are separate. Your tables live in object storage, and compute starts and stops independently. Second, governance is a layer of its own. Permissions attach to Unity Catalog objects, not to individual clusters.
One table, several tools
The same table can be used from SQL and from Python. This SQL creates a managed table. It assumes you can create objects in the main catalog.
CREATE SCHEMA IF NOT EXISTS main.tutorial;
CREATE TABLE IF NOT EXISTS main.tutorial.orders (
order_id BIGINT,
customer_id BIGINT,
amount DECIMAL(10, 2),
order_ts TIMESTAMP
);
INSERT INTO main.tutorial.orders VALUES
(1, 101, 25.00, current_timestamp()),
(2, 102, 40.50, current_timestamp()),
(3, 101, 15.25, current_timestamp());In a notebook attached to compute, PySpark reads the same table by its three-level name, catalog.schema.table. The spark session is predefined there, and display renders a table.
from pyspark.sql import functions as F
df = spark.table("main.tutorial.orders")
totals = (
df.groupBy("customer_id")
.agg(F.sum("amount").alias("total_amount"))
)
display(totals)Both snippets touch the same data. Neither copies it.
Common mistakes
- Treating a cluster as the place data lives. Data lives in object storage. Terminating compute does not delete tables.
- Expecting a notebook to run without compute. A notebook must be attached to compute before any cell executes.
- Using a two-part name. In Unity Catalog, write
catalog.schema.table. A short name only works if a default catalog and schema are set.
Exercise
A teammate says, "If I shut down my cluster, the orders table disappears." Is that correct? Explain using the platform layers.
Show answer
No. The table is stored as Delta files in cloud object storage and its metadata is registered in Unity Catalog. Compute only reads and writes that data. Shutting down the cluster stops processing but leaves the table intact.
Exercise
Which layer would you use to decide that the group data-analysts can read main.tutorial.orders?
Show answer
Unity Catalog, the governance layer. You grant permissions on its objects, not on compute.