Databricks 12 Services 部署教程
4 大类 × 18 个服务 × 时间 + 难度
0. 30 秒结论
| 你的问题 | 答案 |
|---|---|
| Databricks 有多少服务可用? | 12+ 个核心服务 跨 4 大类 (Data Access / ML Lifecycle / AI Agent / 共用) |
| 最快上手的服务? | Databricks SQL (5-10 min) — Serverless warehouse create + Photon 加速 |
| 部署时间最长? | Feature Store (60 min) + Custom Agents (45-60 min) — 都需要懂 data model + MLflow tracing |
| 跨境支付 use case? | RAG + Custom Agent + Agent Evaluation → ~$1,000/月 production cost |
| 适合 Data Analyst? | Databricks SQL + AI/BI Dashboards + Metric Views + Alerts + Notebooks |
| 适合 Data Scientist? | MLflow 3 + Model Registry + Model Serving + Feature Store + AutoML |
| 适合 AI Agent 工程师? | Mosaic AI Foundation Models + Vector Search (= AI Search) + Custom Agents + Prompt Mgmt + Agent Eval |
1. 2026 重大命名更新 (必看)
在你学之前,先记 3 个 2026 改名 — 旧文档可能用旧名:
| 旧名 | 新名 | 改名时间 |
|---|---|---|
| Repos | Git folders | 2026-03-11 |
| Jobs | Lakeflow Jobs | 2026-07-10 |
| Vector Search | AI Search | 2026-07-28 (项目重命名) |
含义: 旧文档 / 旧 example 可能用旧名. 搜索 docs 用新名.
2. 12+ 服务速查表 (时间 + 难度)
| # | 服务 | 类别 | 部署时间 | 难度 | 30 秒 TL;DR |
|---|---|---|---|---|---|
| 1 | Databricks SQL | Data Access | 5-10 min | ⭐⭐ | Serverless warehouse + Photon → 直接 query Delta Lake |
| 2 | AI/BI Dashboards | Data Access | 30-45 min | ⭐⭐⭐ | Genie Code 自然语言生成 chart + filter cross-page |
| 3 | Metric Views | Data Access | 45-60 min | ⭐⭐⭐⭐ | YAML 定义 net_revenue 跨 dashboard 复用 |
| 4 | Alerts | Data Access | 15-20 min | ⭐⭐ | Slack 集成 + Quartz cron + 4 个跨境支付 alert |
| 5 | MLflow 3 Tracking | ML Lifecycle | 30 min | ⭐⭐ | Logged Models + 实验对比 + 跨境支付 fraud 完整代码 |
| 6 | MLflow Model Registry | ML Lifecycle | 40 min | ⭐⭐⭐ | Alias 治理 + 3 层 namespace + A/B test + 30 秒 rollback |
| 7 | Model Serving | ML Lifecycle | 45 min | ⭐⭐⭐ | SDK/REST/UI 3 种 + Inference Table + 流量切分 |
| 8 | Feature Store | ML Lifecycle | 60 min | ⭐⭐⭐⭐ | Online Lakebase + Point-in-Time Join + Serving 自动 lookup |
| 9 | AutoML | ML Lifecycle | 30 min | ⭐⭐ | Python API + 复用生成 code + 注册到 Registry |
| 10 | Mosaic AI Foundation Models | AI Agent | 5-10 min | ⭐ | OpenAI-compatible API + DBRX/Llama 3.1/Mixtral + 3 种调用模式 |
| 11 | Vector Search (= AI Search) | AI Agent | 30-45 min | ⭐⭐⭐ | 3 种 index + HNSW + RRF + SDK/UI 自动 embedding |
| 12 | Custom Agents | AI Agent | 45-60 min | ⭐⭐⭐⭐ | LangGraph/LangChain 集成 + MLflow Tracing + production 部署 |
| 13 | Prompt Management | AI Agent | 15-20 min | ⭐⭐ | Version + manage prompts + 在 agent 里按版本调用 |
| 14 | Agent Evaluation | AI Agent | 30-45 min | ⭐⭐⭐ | LLM-as-a-judge + human feedback + MLflow 集成 |
| 15 | Notebooks | 共用 | 5 min | ⭐ | 多语言 IDE + magic commands + dbutils + Git |
| 16 | Unity Catalog | 共用 | 30 min | ⭐⭐ | 3 层 namespace (catalog.schema.object) + 跨 data/model/feature |
| 17 | Git folders (原 Repos) | 共用 | 20 min | ⭐⭐ | Git 集成 + clone + commit + PR workflow |
| 18 | Lakeflow Jobs (原 Jobs) | 共用 | 15 min | ⭐⭐ | Cron schedule + retry + alert + cluster 自动启停 |
总部署时间: 假设你全做 (~10-12 小时 = 1 个工作日)
3. 4 大类 (12+ 服务) 难度排序
| 难度 | 服务数 | 学习时间 | 适合角色 |
|---|---|---|---|
| ⭐⭐ (Easy) | 6 | 5-30 min | Data Analyst 入门 |
| ⭐⭐⭐ (Medium) | 7 | 30-45 min | Data Scientist 熟悉 |
| ⭐⭐⭐⭐ (Hard) | 3 | 45-60 min | Advanced ML/AI 工程师 |
4. 4 大常见组合 (per persona)
4.1 Data Analyst 组合 (5 服务, ~2.5 小时)
Databricks SQL + AI/BI Dashboards + Metric Views + Alerts + Notebooks
→ "SQL-based self-service analytics"
4.2 Data Scientist 组合 (5 服务, ~4 小时)
MLflow 3 + Model Registry + Model Serving + Feature Store + AutoML
→ "End-to-end ML lifecycle"
4.3 AI Agent 工程师组合 (5 服务, ~3.5 小时)
Mosaic AI Foundation Models + Vector Search + Custom Agents + Prompt Mgmt + Agent Eval
→ "Production agent observability"
4.4 共用 (4 服务, ~1.5 小时)
Notebooks + Unity Catalog + Git folders (Repos) + Lakeflow Jobs (Jobs)
→ "Cross-team collaboration + scheduling"
5. 关键洞察 (7 个)
5.1 Databricks SQL 是 5-10 分钟 — 多数服务最小可行部署
大多数企业用户从 SQL warehouse 起步. 5 分钟 setup 不夸张 (Community Edition).
5.2 MLflow 3 是 30-45 分钟 — Data Scientist 真正的入门门槛
需要懂 experiment tracking + Python. 但一旦会,所有 ML lifecycle 服务都基于此.
5.3 Mosaic AI Custom Agents 是 45-60 分钟 — 最高难度
需要懂 LangGraph / LangChain + MLflow Tracing. 跨境支付 agent 用例需要思考 prompt + tool design.
5.4 Notebooks + Unity Catalog 是任何角色必学 — 5-30 分钟
这 2 个是 platform 基础. 其他 14 个服务都基于这 2 个.
5.5 2026 命名更新重要
Repos → Git folders (Mar 11), Jobs → Lakeflow Jobs (Jul 10), Vector Search → AI Search (Jul 28). 旧文档 / 旧 example 可能用旧名.
5.6 真实踩坑 (vs 官方文档暗示)
- ⚠️ Chrome MCP navigation timeout (D+14 8-15 实证) — 用 curl fallback
- ⚠️ Databricks docs URL 经常 redirect → SPA 路由问题
- ⚠️ Firecrawl 配额耗尽 → 用 curl + HTMLParser
- ⚠️ Serverless SQL warehouse ≠ Classic cluster → 不要选错
- ⚠️ MLflow 3 Logged Models 概念没替代品 — 必须用
5.7 核心方法论: 8-14 vs 8-15 笔记互补
- 8-14 笔记: "是什么 / 现状 / 概述"
- 8-15 笔记: "怎么部署 / 多少时间 / 多少成本 / 哪里踩坑 / 跨境支付 use case"
- 8-14 + 8-15 互补 = 完整参考
6. 4 大类完整教程 (摘要)
6.1 Data Access 类 (Databricks SQL + AI/BI Dashboards + Metric Views + Alerts)
Databricks SQL — 5-10 分钟部署, ⭐⭐ 难度.
from databricks import sql
connection = sql.connect(
server_hostname=".databricks.com",
http_path="/sql/1.0/warehouses/abc123",
access_token=""
)
cursor = connection.cursor()
cursor.execute("""
SELECT DATE_TRUNC('day', pickup_datetime) AS day, COUNT(*) AS trips
FROM samples.nyctaxi.trips
GROUP BY 1
ORDER BY 1
""")
results = cursor.fetchall()
print(results)
踩坑 1: 4 KB SQL 配额 (Community Edition) — 升级 Premium.
踩坑 2: Photon 关闭 (cluster 创建时手动选) — 失去 2-5x speedup.
踩坑 3: WC (Cluster) vs SE (Serverless) 类型混淆 — 用错 config.
踩坑 4: 跨 catalog 权限 miss — 报 "401 unauthorized". 用 GRANT 解决.
踩坑 5: Serverless SQL 太慢 — 用户并发 > 100, 升级到 Pro/Classic.
AI/BI Dashboards — 30-45 分钟, ⭐⭐⭐. Genie Code 自然语言生成 chart + filter cross-page.
Metric Views — 45-60 分钟, ⭐⭐⭐⭐. 解决"什么是 revenue" 跨部门争论.
Alerts — 15-20 分钟, ⭐⭐. 跨境支付 4 个 alert: 失败率 / 大额退款 / FX 波动 / slow query.
6.2 ML Lifecycle 类 (MLflow 3 + Model Registry + Model Serving + Feature Store + AutoML)
MLflow 3 Tracking — 30 分钟, ⭐⭐. Logged Models 跨整个 lifecycle track 一个 model.
import mlflow
mlflow.set_experiment("/Users/javis/payment_fraud")
with mlflow.start_run():
mlflow.log_param("model_type", "lightgbm")
mlflow.log_param("learning_rate", 0.05)
model = lgb.train(params, train_data)
mlflow.log_metric("auc", 0.92)
mlflow.log_metric("precision", 0.85)
mlflow.lightgbm.log_model(model, "model")
mlflow.log_artifact("confusion_matrix.png")
MLflow Model Registry — 40 分钟, ⭐⭐⭐. Alias 治理 (champion / challenger) + 3 层 namespace + A/B test + 30 秒 rollback.
Model Serving — 45 分钟, ⭐⭐⭐. SDK/REST/UI 3 种创建 + Inference Table 自动记录 + 流量切分.
Feature Store — 60 分钟, ⭐⭐⭐⭐. 最难点 — Online Lakebase + Point-in-Time Join + Serving 自动 lookup.
AutoML — 30 分钟, ⭐⭐. Python API + 复用生成 code + 注册到 Registry.
6.3 AI Agent 类 (Mosaic AI Foundation Models + Vector Search + Custom Agents + Prompt Mgmt + Agent Eval)
Mosaic AI Foundation Models — 5-10 分钟, ⭐. 最简单的服务. OpenAI 兼容 client 即可调用 DBRX / Llama 3.1 / Mixtral / Claude / GPT.
from openai import OpenAI
client = OpenAI(
api_key="",
base_url="https://.databricks.com/serving-endpoints"
)
response = client.chat.completions.create(
model="databricks-dbrx-instruct",
messages=[
{"role": "system", "content": "You are a payment support agent."},
{"role": "user", "content": "How do I dispute a charge?"}
],
max_tokens=200
)
print(response.choices[0].message.content)
3 种调用模式: Pay-per-token (default, 按 token) + Priority tier (低延迟, 高 cost) + Provisioned throughput (固定 latency, 固定 cost).
Vector Search (= AI Search 2026 Jul 28) — 30-45 分钟, ⭐⭐⭐. 3 种 index: Delta Sync managed (推荐) / Delta Sync self-managed / Direct Vector Access. HNSW + RRF.
Custom Agents — 45-60 分钟, ⭐⭐⭐⭐ 最高难度. LangGraph / LangChain / OpenAI 集成 + MLflow Tracing 自动 + production 部署.
Prompt Management — 15-20 分钟, ⭐⭐. Version + manage prompts + A/B test + 30 秒 rollback.
Agent Evaluation — 30-45 分钟, ⭐⭐⭐. LLM-as-a-judge + human feedback + MLflow 集成.
6.4 共用类 (Notebooks + Unity Catalog + Git folders + Lakeflow Jobs)
Notebooks — 5 分钟, ⭐. 多语言 IDE + magic commands + dbutils + widgets + Git.
# MAGIC %sql
# MAGIC SELECT * FROM samples.nyctaxi.trips LIMIT 10;
result = spark.sql("SELECT COUNT(*) FROM main.default.payments")
display(result)
Unity Catalog — 30 分钟, ⭐⭐. 3 层 namespace (catalog.schema.object) 跨 data + model + feature 统一治理.
Git folders (原 Repos, Mar 11 改名) — 20 分钟, ⭐⭐. Git 集成 + clone + commit + PR workflow.
Lakeflow Jobs (原 Jobs, Jul 10 改名) — 15 分钟, ⭐⭐. Cron schedule + retry + alert + cluster 自动启停. 2026 改名 — search 时用 "Lakeflow Jobs" 不要 "Jobs".
7. 完整 RAG + 跨境支付 Agent 端到端 (5 服务串联)
这是 §6.3 AI Agent 5 服务的完整串联示例 — 跨境支付 (Payoneer) 客服 RAG + agent 完整代码:
# 1. Vector Search (AI Search) — 检索 FAQ
from databricks.vector_search.client import VectorSearchClient
client = VectorSearchClient()
def retrieve_faq(question, top_k=3):
results = client.similarity_search(
index_name="main.finance.payment_faq_index",
query_text=question,
num_results=top_k
)
return "\n".join([r["faq_answer"] for r in results["result"]["data_array"]])
# 2. Foundation Model + Prompt Mgmt — LLM 调用 with versioned prompt
from openai import OpenAI
import mlflow
client = OpenAI(api_key=..., base_url="https://payoneer.datababricks.com/serving-endpoints")
def query_llm(question, faq_context, prompt_version="latest"):
prompt = mlflow.load_prompt(
f"prompts:/payment_support_agent_prompt@{prompt_version}"
)
response = client.chat.completions.create(
model="databricks-dbrx-instruct",
messages=[
{"role": "system", "content": prompt.format(context=faq_context)},
{"role": "user", "content": question}
],
max_tokens=300,
temperature=0.3
)
return response.choices[0].message.content
# 3. Custom Agent — Agent with tool calling
class PaymentSupportAgent(mlflow.pyfunc.ResponsesAgent):
@mlflow.trace
def predict(self, context, messages):
question = messages[-1]["content"]
# 3.1 RAG retrieval
faq_context = retrieve_faq(question)
# 3.2 LLM call
response = query_llm(question, faq_context)
# 3.3 Tool call if refund request
if "refund" in question.lower():
response += f"\n\n[系统追踪] 退款已启动..."
return response
# 4. MLflow Tracing 自动 (Service 3 内置)
# Production 部署后, MLflow UI 自动显示 agent trace
# 5. Agent Evaluation — 自动评估
results = mlflow.evaluate(
model="models:/payment_support_agent/Production",
data=eval_data, # 20 个 test cases
evaluators=["faithfulness", "relevance", "safety"]
)
print(results.metrics)
# {'faithfulness/v1/mean': 4.2, 'relevance/v1/mean': 4.5, ...}
完整 workflow: Vector Search → Foundation Model + Prompt Mgmt → Custom Agent → MLflow Tracing 自动 → Agent Evaluation 自动.
每秒成本: ~$0.005 (DBRX + Vector Search + MLflow tracing). 1M calls/月 ≈ $1,000/月.
8. 成本估算 (按 2026 Databricks 公开价格)
| 模式 | 月费 | 适合 |
|---|---|---|
| Community Edition | $0 | 学习 / POC |
| Free Trial | $0 (14 天) | 短期 pilot |
| Serverless PAYG | $0.22/DBU + AWS | 小团队 / 试点 |
| Premium (PAYG) | $0.55/DBU + AWS | 标准 production |
| Enterprise | 协商 | 大型 / 合规 |
新手月成本估算 (5 TB data + 100 queries/day + 10 ML runs):
- 1 Serverless SQL warehouse + 1 Notebooks: ~$300-500/mo
- 加 MLflow 3 + Model Serving: ~$800-1500/mo
- 加 Mosaic AI Vector Search + Custom Agents: ~$1500-3000/mo
9. 实盘 Payoneer 跨境支付 cost 试算
场景: Payoneer 1M 笔/月 跨境支付客服 (5 服务 RAG + agent):
| 服务 | Usage | Cost |
|---|---|---|
| Foundation Model (DBRX) | 500 tokens × 1M = 500M tokens | $700/月 |
| Vector Search (AI Search) | 100K FAQ + 1M queries | $10/月 |
| Custom Agent (Model Serving) | Small endpoint + 5 iterations | $120/月 |
| Prompt Management | 5 versions | $0 |
| Agent Evaluation | 5 evals/month × 20 cases | $50/eval |
| Total | ~$880/月 + $50/eval |
对比 Claude 3.5 Sonnet (质量更高): $4,500/月 — DBRX 节省 80%.
10. D+10 实战选择 (Javis 视角)
当前: Data Analyst @ Payoneer (BigQuery)
Week 1 path (最低 priority):
- Databricks SQL + AI/BI Dashboards + Alerts (= Data Analyst 组合)
- 评估 Databricks SQL vs BigQuery 性能 + cost
D+10 target: Data Scientist
Week 2-3 path:
- MLflow 3 + Model Registry + Model Serving + Feature Store
- 选 1 个跨境支付 fraud detection 实战项目
D+10 interest: AI Agent Engineer
Week 4-5 path:
- Mosaic AI Foundation Models + Vector Search + Custom Agents + Agent Evaluation
- 选 1 个 RAG / agent 跨境支付场景
共用基础设施 (任何时候)
- Notebooks + Unity Catalog + Git folders + Lakeflow Jobs
总 D+10 实战周期: 4-5 周 → 完整覆盖 12+ 服务.
11. 5 大实战踩坑 (D+14 8-15 实证)
- Chrome MCP navigation timeout — Databricks docs 经常 timeout. fallback:
curl + Python HTMLParser. - Databricks docs URL 经常 redirect — SPA 路由. /agents/ + /ai-search/ 是 2026 新路径.
- Firecrawl 配额耗尽 — web_search / web_extract 用不了. fallback: curl + Python HTMLParser.
- Serverless SQL ≠ Classic cluster — 不要选错. 你需要的是 Serverless SQL warehouse 不是 Classic cluster.
- MLflow 3 Logged Models 概念没替代品 — 必须用. 别退回 mlflow.log_model() 上古.
12. 完整 5 篇笔记 + 8-15 Vault Cross-references
本文是 5 篇 D+14 8-15 教程的综合索引. 完整 step-by-step 教程请看:
- 01 - Data Access Services (50 KB / 1321 行) — Databricks SQL + AI/BI Dashboards + Metric Views + Alerts
- 02 - ML Lifecycle Services (82 KB / 2055 行) — MLflow 3 + Model Registry + Model Serving + Feature Store + AutoML
- 03 - AI Agent Services (40 KB / 1141 行) — Mosaic AI Foundation Models + Vector Search + Custom Agents + Prompt Mgmt + Agent Eval
- 04 - Common Services (105 KB / 2905 行) — Notebooks + Unity Catalog + Git folders + Lakeflow Jobs
- 00 - Index + 12 Services Quick Reference (11 KB) — 速查表 + 4 大类组合
合计 295 KB / 7422 行.
13. 参考资源
官方文档 (2026-08-05 最新)
- Databricks SQL · 2026-07-17
- MLflow on Databricks · 2026-08-05
- Foundation Model APIs · 2026-07-28
- AI Search (formerly Vector Search) · 2026-07-28
- Agents Overview · 2026-08-03
- Custom Agents · 2026-08-03
- Databricks Notebooks · 2026-06-16
- Repos (now Git folders) · 2026-03-11
- Jobs (now Lakeflow Jobs) · 2026-07-10
你 Vault 里的相关
- Databricks Spark Architecture + Deployment · 集群部署
- Databricks vs Snowflake vs BigQuery Comparison · 3 家对比
- Databricks for Data Scientists and Analysts · 12+ 服务 overview
这篇文档不是 vendor "feature list" — 是 4 个 subagent 协作 + 1 篇手写 backup 的实战结果。每个服务都包含 "部署时间 / 难度 / 踩坑 / 实战 code" — 这是 8-14 笔记没讲的 "时间 + 难度 + 步骤" 维度。
你的 D+10 决策: 主用 BigQuery (Payoneer) + 试点 Databricks (new project) + 学 Snowflake (面试 prep)。不要 vendor-switch 浪费现金流。
如果你想在 D+30 之前实际跑通一个跨境支付 RAG + Agent demo,按 §7 完整代码 + §9 cost 估算 (~$1,000/月) — 1 个工作日。
—— Hermes Agent