Skip to content

Split View: Databricks AI Engineer (FDE) 합격 가이드: Spark, Unity Catalog, RAG부터 고객 배포까지

✨ Learn with Quiz
|

Databricks AI Engineer (FDE) 합격 가이드: Spark, Unity Catalog, RAG부터 고객 배포까지

1. Databricks와 FDE 팀 이해

Databricks란 무엇인가

Databricks는 2013년 UC Berkeley AMPLab에서 탄생한 데이터 + AI 플랫폼 기업입니다. Apache Spark의 창시자들(Ali Ghodsi, Matei Zaharia 등)이 공동 창업했으며, 2024년 기준 기업가치 약 620억 달러로 세계에서 가장 가치 있는 비상장 AI 기업 중 하나입니다.

Databricks의 핵심 혁신:

  • Apache Spark 창시: 빅데이터 처리의 사실상 표준이 된 분산 컴퓨팅 프레임워크
  • Lakehouse Architecture 발명: Data Lake의 유연성과 Data Warehouse의 안정성을 결합한 차세대 아키텍처
  • Delta Lake 오픈소스화: ACID 트랜잭션을 지원하는 스토리지 레이어
  • Unity Catalog: 데이터, AI 모델, 피처를 통합 관리하는 거버넌스 플랫폼
  • Mosaic AI: 2024년 MosaicML 인수 후 통합된 AI/ML 플랫폼 브랜드

기업 규모와 성장:

  • ARR(Annual Recurring Revenue) 약 16억 달러(2024년)
  • 고객사 10,000개 이상, Fortune 500 중 60% 이상이 사용
  • 직원 7,000명 이상, 전 세계 30개 이상 오피스
  • AWS, Azure, GCP 세 클라우드 모두에서 운영되는 유일한 Lakehouse 플랫폼

FDE(Forward Deployed Engineer) 팀이란

Databricks의 FDE 팀은 Professional Services 조직 내 핵심 엔지니어링 팀입니다. 고객 현장에서 직접 Databricks 플랫폼을 구축하고 최적화하며, 가장 복잡한 데이터/AI 과제를 해결하는 역할을 합니다.

FDE의 핵심 미션:

  • 엔터프라이즈 고객의 데이터 플랫폼을 Databricks Lakehouse로 마이그레이션
  • 고객 환경에 맞춤화된 RAG/AI 파이프라인 구축
  • 성능 최적화: Spark 잡 튜닝, 비용 최적화, 아키텍처 개선
  • 기술 전수: 고객 엔지니어링 팀의 역량 향상 지원

FDE vs Field Engineer vs Solutions Architect

이 세 역할은 자주 혼동되지만 책임과 성격이 다릅니다.

구분FDE (Forward Deployed Engineer)Field EngineerSolutions Architect
주요 활동고객 현장에서 직접 코드 작성 및 구현프리세일즈 기술 데모 및 POC아키텍처 설계 및 기술 자문
코딩 비중70-80%30-40%10-20%
고객 접점구현 팀과 긴밀 협업의사결정자 및 기술 리더C레벨 및 아키텍트
프로젝트 기간2-6개월 장기1-4주 단기스팟성 자문
성과 지표프로젝트 성공률, 고객 만족도파이프라인 기여도, 기술 승인딜 클로즈 기여

보상 패키지

Databricks의 FDE는 업계에서 매우 경쟁력 있는 보상을 제공합니다.

2025년 기준 총 보상(TC) 범위:

  • Junior FDE (0-2년): 약 180K-230K 달러
  • Mid-level FDE (3-5년): 약 230K-350K 달러
  • Senior FDE (5년 이상): 약 350K-486K+ 달러
  • FDE 평균 TC: 약 238K 달러

보상 구조:

  • 기본급: TC의 약 50-60%
  • RSU(Restricted Stock Units): TC의 약 30-40% (IPO 전 주식이므로 상장 시 큰 상승 가능)
  • 연간 보너스: TC의 약 10-15%
  • 추가 혜택: 출장 수당, 학습 지원금(연 5,000달러), 건강보험, 401(k) 매칭

2. JD(Job Description) 상세 분석

핵심 책임

Databricks FDE의 JD를 분해하면 크게 4가지 카테고리로 나뉩니다.

1. 고객 데이터 플랫폼 구축

  • 고객의 기존 데이터 인프라(Hadoop, Snowflake, 레거시 DW)를 Databricks Lakehouse로 마이그레이션
  • Medallion Architecture(Bronze/Silver/Gold) 설계 및 구현
  • ETL/ELT 파이프라인 최적화

2. RAG/AI 파이프라인 구현

  • Mosaic AI를 활용한 RAG 파이프라인 구축
  • Vector Search Index 설계 및 최적화
  • Model Serving Endpoint 배포 및 모니터링
  • 고객 데이터에 맞춤화된 AI Agent 구현

3. 기술 리더십

  • 고객 엔지니어링 팀과의 기술 워크숍 진행
  • 아키텍처 리뷰 및 베스트 프랙티스 전수
  • POC(Proof of Concept) 설계 및 실행

4. 프로젝트 관리

  • 구현 일정 수립 및 마일스톤 관리
  • 기술 리스크 식별 및 완화
  • PS(Professional Services)에서 Customer Success 팀으로의 핸드오프

필수 요구사항

  • Apache Spark: 분산 데이터 처리의 핵심. PySpark 또는 Scala Spark 능숙
  • Python/Scala: 데이터 엔지니어링과 ML 파이프라인 개발의 주 언어
  • SQL: 복잡한 분석 쿼리 작성, 성능 최적화, Spark SQL 활용
  • 클라우드 플랫폼: AWS, Azure, GCP 중 최소 1개 깊은 경험. 멀티 클라우드 우대
  • 데이터 모델링: Star Schema, Snowflake Schema, 비정규화 전략
  • 고객 대응 경험: 기술 컨설팅 또는 Professional Services 경험

우대 요구사항

  • Delta Lake: ACID 트랜잭션, Time Travel, Schema Evolution 실무 경험
  • MLflow: 실험 추적, 모델 레지스트리, 모델 서빙 경험
  • Unity Catalog: 데이터 거버넌스, 리니지 추적, 접근 제어 경험
  • Terraform/Pulumi: Databricks 워크스페이스 IaC 프로비저닝
  • Streaming: Spark Structured Streaming, Kafka, Event Hubs 경험
  • ML/AI: 피처 엔지니어링, 모델 학습/배포, RAG 파이프라인 구축

3. 기술 딥다이브

3-1. Apache Spark 마스터리

Apache Spark는 Databricks의 기술적 핵심입니다. FDE라면 단순히 사용할 줄 아는 것이 아니라 내부 동작 원리를 깊이 이해해야 합니다.

RDD에서 DataFrame, Dataset으로의 진화

# RDD (2014) - 저수준 API, 타입 안전하지만 최적화 어려움
rdd = sc.parallelize([1, 2, 3, 4, 5])
result = rdd.filter(lambda x: x > 2).map(lambda x: x * 2).collect()

# DataFrame (2015) - SQL 친화적, Catalyst Optimizer 활용
df = spark.read.parquet("s3://data/events/")
result = df.filter(df.age > 25).groupBy("city").count()

# Dataset (Scala only) - DataFrame + 컴파일 타임 타입 안전성
# Python에서는 DataFrame이 곧 Dataset[Row]

Catalyst Optimizer와 Tungsten Engine

Spark SQL의 성능은 Catalyst Optimizer와 Tungsten Engine에 달려 있습니다.

# Catalyst의 최적화 단계를 확인하는 방법
df = spark.read.parquet("s3://data/sales/")
optimized = df.filter("amount > 1000").join(
    spark.read.parquet("s3://data/customers/"),
    "customer_id"
)

# 논리적/물리적 실행 계획 확인
optimized.explain(True)

# 출력 예시:
# == Parsed Logical Plan ==
# == Analyzed Logical Plan ==
# == Optimized Logical Plan ==   <-- Predicate Pushdown, Column Pruning 적용됨
# == Physical Plan ==             <-- Join 전략(BroadcastHashJoin 등) 결정됨

Catalyst의 핵심 최적화:

  • Predicate Pushdown: 필터 조건을 데이터 소스 레벨로 밀어내려 불필요한 데이터 읽기 최소화
  • Column Pruning: 필요한 컬럼만 읽어 I/O 최소화
  • Constant Folding: 컴파일 시점에 상수 표현식 평가
  • Join Reordering: 조인 순서를 최적화하여 셔플 데이터 최소화

Tungsten Engine의 역할:

  • 오프-힙 메모리 관리로 GC 부담 감소
  • 코드 제너레이션(Whole-Stage CodeGen)으로 가상 함수 호출 제거
  • 캐시 친화적 데이터 구조 사용

파티셔닝, 셔플 최적화, AQE

# 파티셔닝 전략 - 데이터 분포에 따른 최적화
# 1. Hash Partitioning (기본)
df.repartition(200, "customer_id")

# 2. Range Partitioning - 정렬된 데이터에 유리
df.repartitionByRange(200, "event_date")

# 3. 셔플 최적화 - broadcast join 사용
from pyspark.sql.functions import broadcast

# 작은 테이블(10MB 이하)을 브로드캐스트하여 셔플 제거
result = large_df.join(broadcast(small_df), "key")

# 4. Salting - 데이터 스큐 해결
from pyspark.sql.functions import concat, lit, rand, floor

# 핫키에 소금(salt) 추가하여 균등 분배
salt_range = 10
skewed_df = skewed_df.withColumn(
    "salted_key",
    concat("key", lit("_"), floor(rand() * salt_range).cast("string"))
)

# AQE (Adaptive Query Execution) - Spark 3.0+
# spark.conf 설정
spark.conf.set("spark.sql.adaptive.enabled", "true")
spark.conf.set("spark.sql.adaptive.coalescePartitions.enabled", "true")
spark.conf.set("spark.sql.adaptive.skewJoin.enabled", "true")

AQE의 핵심 기능:

  • 셔플 파티션 자동 병합(Coalesce Shuffle Partitions)
  • 스큐 조인 자동 최적화(Skew Join Optimization)
  • 런타임 시 조인 전략 전환(Sort-Merge Join에서 Broadcast Hash Join으로)

PySpark vs Scala Spark

# PySpark - 데이터 과학자와의 협업에 유리
from pyspark.sql import SparkSession
from pyspark.sql.functions import col, when, sum as spark_sum

spark = SparkSession.builder.appName("etl").getOrCreate()

df = (
    spark.read.format("delta")
    .load("s3://lakehouse/bronze/events")
    .filter(col("event_date") >= "2025-01-01")
    .withColumn("category",
        when(col("amount") > 1000, "high")
        .when(col("amount") > 100, "medium")
        .otherwise("low")
    )
    .groupBy("category")
    .agg(spark_sum("amount").alias("total_amount"))
)
// Scala Spark - 타입 안전성, 더 나은 성능
import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.functions._

val spark = SparkSession.builder.appName("etl").getOrCreate()
import spark.implicits._

val df = spark.read.format("delta")
  .load("s3://lakehouse/bronze/events")
  .filter($"event_date" >= "2025-01-01")
  .withColumn("category",
    when($"amount" > 1000, "high")
    .when($"amount" > 100, "medium")
    .otherwise("low")
  )
  .groupBy("category")
  .agg(sum("amount").alias("total_amount"))

선택 기준:

  • PySpark: ML/AI 파이프라인, 데이터 과학 팀 협업, 프로토타이핑
  • Scala Spark: 성능 크리티컬 ETL, 스트리밍 파이프라인, 라이브러리 개발

3-2. Delta Lake와 Medallion Architecture

ACID 트랜잭션과 Time Travel

Delta Lake는 Parquet 위에 트랜잭션 로그(_delta_log/)를 추가하여 ACID를 보장합니다.

# Delta Lake 기본 CRUD
# 1. 테이블 생성
df.write.format("delta").mode("overwrite").saveAsTable("lakehouse.bronze.raw_events")

# 2. 업데이트 (MERGE/UPSERT)
from delta.tables import DeltaTable

target = DeltaTable.forName(spark, "lakehouse.silver.customers")
source = spark.read.format("delta").load("s3://staging/new_customers/")

target.alias("t").merge(
    source.alias("s"),
    "t.customer_id = s.customer_id"
).whenMatchedUpdate(set={
    "name": "s.name",
    "email": "s.email",
    "updated_at": "current_timestamp()"
}).whenNotMatchedInsertAll().execute()

# 3. Time Travel - 과거 버전 조회
df_v5 = spark.read.format("delta").option("versionAsOf", 5).load(path)
df_yesterday = spark.read.format("delta").option("timestampAsOf", "2025-03-22").load(path)

# 4. RESTORE - 테이블을 과거 버전으로 복원
spark.sql("RESTORE TABLE lakehouse.silver.customers VERSION AS OF 5")

Medallion Architecture 구현

# Bronze Layer - 원본 데이터 그대로 적재 (Append-only)
raw_df = (
    spark.readStream
    .format("cloudFiles")  # Auto Loader
    .option("cloudFiles.format", "json")
    .option("cloudFiles.schemaLocation", "s3://schema/bronze/events/")
    .load("s3://raw-data/events/")
)

bronze_df = raw_df.withColumn("_ingested_at", current_timestamp())

bronze_df.writeStream \
    .format("delta") \
    .outputMode("append") \
    .option("checkpointLocation", "s3://checkpoints/bronze/events/") \
    .trigger(availableNow=True) \
    .toTable("lakehouse.bronze.raw_events")

# Silver Layer - 정제된 데이터 (Dedup, Cleansing, Type Casting)
silver_df = (
    spark.readStream.table("lakehouse.bronze.raw_events")
    .dropDuplicates(["event_id"])
    .filter(col("event_type").isNotNull())
    .withColumn("amount", col("amount").cast("decimal(18,2)"))
    .withColumn("event_date", to_date(col("event_timestamp")))
)

silver_df.writeStream \
    .format("delta") \
    .outputMode("append") \
    .option("checkpointLocation", "s3://checkpoints/silver/events/") \
    .trigger(availableNow=True) \
    .toTable("lakehouse.silver.clean_events")

# Gold Layer - 비즈니스 집계 테이블
gold_df = (
    spark.read.table("lakehouse.silver.clean_events")
    .groupBy("customer_id", "event_date")
    .agg(
        count("*").alias("event_count"),
        spark_sum("amount").alias("daily_total"),
        avg("amount").alias("avg_amount")
    )
)

gold_df.write.format("delta").mode("overwrite") \
    .saveAsTable("lakehouse.gold.customer_daily_summary")

Change Data Feed (CDF)

-- CDF 활성화
ALTER TABLE lakehouse.silver.customers SET TBLPROPERTIES (delta.enableChangeDataFeed = true);

-- CDF 조회: 변경된 레코드만 추출
SELECT * FROM table_changes('lakehouse.silver.customers', 5)
WHERE _change_type IN ('insert', 'update_postimage');

Delta Lake 4.0 새 기능

  • Liquid Clustering: Z-ORDER를 대체하는 자동 클러스터링. 쿼리 패턴에 따라 동적으로 데이터를 재배치
  • UniForm: Delta, Iceberg, Hudi 포맷 간 자동 변환. 외부 시스템과의 호환성 극대화
  • Deletion Vectors: 대량 삭제 시 파일 재작성 없이 삭제 벡터로 표시하여 성능 개선
  • Row Tracking: 행 레벨 변경 추적으로 CDC 파이프라인 간소화
-- Liquid Clustering 설정
CREATE TABLE lakehouse.silver.events
CLUSTER BY (event_date, customer_id)
AS SELECT * FROM lakehouse.bronze.raw_events;

-- OPTIMIZE가 자동으로 최적 클러스터링 적용
OPTIMIZE lakehouse.silver.events;

3-3. Unity Catalog와 Data Governance

3레벨 네임스페이스

Unity Catalog는 catalog.schema.table 형태의 3레벨 네임스페이스를 사용합니다.

-- 카탈로그 생성
CREATE CATALOG production;
CREATE CATALOG development;

-- 스키마(데이터베이스) 생성
CREATE SCHEMA production.finance;
CREATE SCHEMA production.marketing;

-- 테이블 참조
SELECT * FROM production.finance.transactions
WHERE transaction_date >= '2025-01-01';

-- 크로스 카탈로그 조인
SELECT a.*, b.segment
FROM production.finance.transactions a
JOIN production.marketing.customer_segments b
ON a.customer_id = b.customer_id;

데이터 리니지 추적

Unity Catalog는 자동으로 데이터 리니지를 추적합니다. 어떤 테이블이 어떤 소스에서 왔는지, 어떤 노트북/잡이 데이터를 변환했는지 시각화할 수 있습니다.

# 리니지는 자동 추적되므로 별도 코드 불필요
# UI에서 확인하거나 REST API로 조회 가능

# Unity Catalog REST API로 리니지 조회
import requests

response = requests.get(
    "https://workspace.cloud.databricks.com/api/2.1/unity-catalog/lineage/table-lineage",
    headers=headers,
    params={"table_name": "production.finance.transactions"}
)

Row/Column Level Security

-- Column Level Security: 마스킹 함수 정의
CREATE FUNCTION production.finance.mask_ssn(ssn STRING)
RETURNS STRING
RETURN CASE
    WHEN IS_ACCOUNT_GROUP_MEMBER('finance_admins') THEN ssn
    ELSE CONCAT('***-**-', RIGHT(ssn, 4))
END;

-- 컬럼에 마스킹 함수 적용
ALTER TABLE production.finance.customers
ALTER COLUMN ssn SET MASK production.finance.mask_ssn;

-- Row Level Security: 행 필터 함수 정의
CREATE FUNCTION production.finance.region_filter(region STRING)
RETURNS BOOLEAN
RETURN CASE
    WHEN IS_ACCOUNT_GROUP_MEMBER('global_admins') THEN TRUE
    WHEN IS_ACCOUNT_GROUP_MEMBER('apac_team') AND region = 'APAC' THEN TRUE
    ELSE FALSE
END;

ALTER TABLE production.finance.transactions
SET ROW FILTER production.finance.region_filter ON (region);

Attribute-based Access Control

-- 태그 기반 접근 제어
ALTER TABLE production.finance.transactions SET TAGS ('pii' = 'true', 'classification' = 'confidential');

-- 태그 기반 정책
GRANT SELECT ON TABLE production.finance.transactions
TO `data_analysts`
WHERE TAGS('classification') != 'confidential';

3-4. MLflow on Databricks

실험 추적과 모델 레지스트리

import mlflow
from mlflow.tracking import MlflowClient

# 실험 생성 및 실행
mlflow.set_experiment("/Shared/customer-churn-prediction")

with mlflow.start_run(run_name="xgboost_v2") as run:
    # 하이퍼파라미터 로깅
    mlflow.log_param("max_depth", 6)
    mlflow.log_param("learning_rate", 0.1)
    mlflow.log_param("n_estimators", 200)

    # 모델 학습
    model = xgb.XGBClassifier(max_depth=6, learning_rate=0.1, n_estimators=200)
    model.fit(X_train, y_train)

    # 메트릭 로깅
    predictions = model.predict(X_test)
    accuracy = accuracy_score(y_test, predictions)
    mlflow.log_metric("accuracy", accuracy)
    mlflow.log_metric("f1_score", f1_score(y_test, predictions))

    # 모델 아티팩트 로깅
    mlflow.xgboost.log_model(model, "model")

    # Unity Catalog에 모델 등록
    mlflow.register_model(
        f"runs:/{run.info.run_id}/model",
        "production.ml_models.churn_predictor"
    )

Feature Store 연동

from databricks.feature_engineering import FeatureEngineeringClient

fe = FeatureEngineeringClient()

# 피처 테이블 생성
fe.create_table(
    name="production.features.customer_features",
    primary_keys=["customer_id"],
    timestamp_keys=["event_date"],
    df=customer_features_df,
    description="고객 행동 피처: 최근 구매 빈도, 평균 구매 금액, 마지막 로그인 일수"
)

# 피처 룩업으로 학습 데이터 생성
from databricks.feature_engineering import FeatureLookup

training_set = fe.create_training_set(
    df=label_df,
    feature_lookups=[
        FeatureLookup(
            table_name="production.features.customer_features",
            lookup_key="customer_id",
            timestamp_lookup_key="event_date"
        )
    ],
    label="churned"
)

training_df = training_set.load_df()

자동 로깅(Autolog)

# Autolog 활성화 - 하이퍼파라미터, 메트릭, 모델을 자동 추적
mlflow.autolog()

# 이후 모든 학습이 자동으로 MLflow에 기록됨
from sklearn.ensemble import RandomForestClassifier
model = RandomForestClassifier(n_estimators=100, max_depth=10)
model.fit(X_train, y_train)
# 자동으로: params, metrics, model artifact, feature importance 등이 기록됨

Model Serving Endpoint 배포

import requests
import json

# Model Serving Endpoint 생성 (REST API)
endpoint_config = {
    "name": "churn-predictor-endpoint",
    "config": {
        "served_entities": [{
            "entity_name": "production.ml_models.churn_predictor",
            "entity_version": "3",
            "workload_size": "Small",
            "scale_to_zero_enabled": True
        }],
        "auto_capture_config": {
            "catalog_name": "production",
            "schema_name": "ml_monitoring",
            "table_name_prefix": "churn_predictor"
        }
    }
}

# 엔드포인트에 추론 요청
response = requests.post(
    "https://workspace.cloud.databricks.com/serving-endpoints/churn-predictor-endpoint/invocations",
    headers=headers,
    json={"dataframe_records": [{"customer_id": "C001", "purchase_count": 12, "avg_amount": 150.0}]}
)

3-5. Mosaic AI (RAG와 Agents)

Vector Search Index 생성

from databricks.vector_search.client import VectorSearchClient

vsc = VectorSearchClient()

# Vector Search 엔드포인트 생성
vsc.create_endpoint(name="rag-endpoint", endpoint_type="STANDARD")

# Delta Sync Index 생성 - Delta 테이블 변경 시 자동 동기화
vsc.create_delta_sync_index(
    endpoint_name="rag-endpoint",
    index_name="production.rag.document_index",
    source_table_name="production.rag.documents",
    pipeline_type="TRIGGERED",
    primary_key="doc_id",
    embedding_source_column="content",
    embedding_model_endpoint_name="databricks-bge-large-en"
)

RAG 파이프라인 구축

RAG 파이프라인은 Chunk, Embed, Search, Generate 4단계로 구성됩니다.

from langchain_community.document_loaders import PyPDFLoader
from langchain.text_splitter import RecursiveCharacterTextSplitter

# Step 1: Document Chunking
loader = PyPDFLoader("dbfs:/documents/product_manual.pdf")
documents = loader.load()

text_splitter = RecursiveCharacterTextSplitter(
    chunk_size=1000,
    chunk_overlap=200,
    separators=["\n\n", "\n", ". ", " "]
)
chunks = text_splitter.split_documents(documents)

# Step 2: Embedding (Databricks Foundation Model 사용)
# 청크를 Delta 테이블에 저장하면 Vector Search Index가 자동 임베딩
chunks_df = spark.createDataFrame([
    {"doc_id": f"doc_{i}", "content": chunk.page_content, "metadata": str(chunk.metadata)}
    for i, chunk in enumerate(chunks)
])
chunks_df.write.format("delta").mode("append").saveAsTable("production.rag.documents")

# Step 3: Search (유사도 검색)
results = vsc.get_index("rag-endpoint", "production.rag.document_index").similarity_search(
    query_text="제품 보증 정책은 무엇인가요?",
    columns=["content", "metadata"],
    num_results=5
)

# Step 4: Generate (LLM으로 답변 생성)
import mlflow.deployments

client = mlflow.deployments.get_deploy_client("databricks")

context = "\n".join([r["content"] for r in results["result"]["data_array"]])
prompt = f"""다음 컨텍스트를 기반으로 질문에 답하세요.

컨텍스트:
{context}

질문: 제품 보증 정책은 무엇인가요?
답변:"""

response = client.predict(
    endpoint="databricks-meta-llama-3-1-70b-instruct",
    inputs={"prompt": prompt, "max_tokens": 500, "temperature": 0.1}
)

Mosaic AI Agent Framework

from databricks.agents import Agent, AgentTool

# 에이전트 도구 정의
search_tool = AgentTool(
    name="document_search",
    description="사내 문서에서 관련 정보를 검색합니다",
    func=lambda query: vsc.get_index("rag-endpoint", "production.rag.document_index")
        .similarity_search(query_text=query, num_results=3)
)

sql_tool = AgentTool(
    name="data_query",
    description="데이터베이스에서 비즈니스 데이터를 조회합니다",
    func=lambda query: spark.sql(query).toPandas().to_dict()
)

# 에이전트 생성
agent = Agent(
    model="databricks-meta-llama-3-1-70b-instruct",
    tools=[search_tool, sql_tool],
    system_prompt="당신은 고객 지원 에이전트입니다. 문서 검색과 데이터 조회를 통해 정확한 답변을 제공하세요."
)

Model Gateway

# Model Gateway - 여러 LLM 프로바이더를 단일 인터페이스로 통합
# Databricks UI에서 설정하거나 REST API 사용

# OpenAI 모델을 Databricks Gateway를 통해 호출
response = client.predict(
    endpoint="openai-gpt4-gateway",
    inputs={"messages": [{"role": "user", "content": "분석 보고서를 작성해주세요"}]}
)

# Anthropic Claude를 Gateway를 통해 호출
response = client.predict(
    endpoint="anthropic-claude-gateway",
    inputs={"messages": [{"role": "user", "content": "코드를 리뷰해주세요"}]}
)

# 오픈소스 모델 (Llama, Mistral 등)도 동일 인터페이스
response = client.predict(
    endpoint="databricks-meta-llama-3-1-70b-instruct",
    inputs={"prompt": "데이터를 요약해주세요", "max_tokens": 300}
)

3-6. Spark Structured Streaming

Trigger Modes

# 1. Available Now - 현재 가용한 데이터만 처리 후 종료 (배치-스트리밍 통합)
query = (
    df.writeStream
    .format("delta")
    .trigger(availableNow=True)
    .option("checkpointLocation", checkpoint_path)
    .toTable("lakehouse.silver.events")
)

# 2. Processing Time - 지정 간격마다 마이크로배치 실행
query = (
    df.writeStream
    .format("delta")
    .trigger(processingTime="30 seconds")
    .option("checkpointLocation", checkpoint_path)
    .toTable("lakehouse.silver.events")
)

# 3. Continuous (실험적) - 밀리초 지연시간의 실시간 처리
query = (
    df.writeStream
    .format("delta")
    .trigger(continuous="1 second")
    .option("checkpointLocation", checkpoint_path)
    .toTable("lakehouse.silver.events")
)

Watermarking과 Late Data Handling

# 이벤트 시간 기반 윈도우 집계 + 워터마크
from pyspark.sql.functions import window

windowed_counts = (
    events_df
    .withWatermark("event_time", "10 minutes")  # 10분 지연까지 허용
    .groupBy(
        window("event_time", "5 minutes", "1 minute"),  # 5분 윈도우, 1분 슬라이드
        "device_type"
    )
    .count()
)

windowed_counts.writeStream \
    .format("delta") \
    .outputMode("append") \
    .trigger(processingTime="1 minute") \
    .option("checkpointLocation", checkpoint_path) \
    .toTable("lakehouse.gold.device_counts_5min")

Delta Live Tables (DLT)

import dlt
from pyspark.sql.functions import col, current_timestamp

# Bronze: 원본 데이터 수집
@dlt.table(
    name="bronze_events",
    comment="원본 이벤트 데이터",
    table_properties={"quality": "bronze"}
)
def bronze_events():
    return (
        spark.readStream
        .format("cloudFiles")
        .option("cloudFiles.format", "json")
        .load("s3://raw-data/events/")
    )

# Silver: 데이터 품질 검증 포함
@dlt.table(
    name="silver_events",
    comment="정제된 이벤트 데이터"
)
@dlt.expect_or_drop("valid_event_id", "event_id IS NOT NULL")
@dlt.expect_or_fail("valid_amount", "amount >= 0")
@dlt.expect("valid_email", "email RLIKE '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+$'")
def silver_events():
    return (
        dlt.read_stream("bronze_events")
        .dropDuplicates(["event_id"])
        .withColumn("processed_at", current_timestamp())
    )

# Gold: 비즈니스 집계
@dlt.table(
    name="gold_daily_summary",
    comment="일별 비즈니스 요약"
)
def gold_daily_summary():
    return (
        dlt.read("silver_events")
        .groupBy("event_date", "category")
        .agg(
            count("*").alias("total_events"),
            spark_sum("amount").alias("total_amount")
        )
    )

Auto Loader

# Auto Loader - 클라우드 스토리지의 신규 파일을 자동 감지하여 수집
df = (
    spark.readStream
    .format("cloudFiles")
    .option("cloudFiles.format", "json")
    .option("cloudFiles.schemaLocation", "s3://schema/auto_loader/events/")
    .option("cloudFiles.inferColumnTypes", "true")
    .option("cloudFiles.schemaEvolutionMode", "addNewColumns")
    .load("s3://raw-data/events/")
)

# Auto Loader의 장점:
# 1. 파일 목록 관리 불필요 - 신규 파일 자동 감지
# 2. 스키마 추론 및 진화 - 새 컬럼 자동 추가
# 3. 정확히 한 번(exactly-once) 처리 보장
# 4. 수백만 파일에서도 효율적 (파일 알림 모드)

3-7. 클라우드 인프라

AWS 환경

# AWS에서의 Databricks 아키텍처
# 1. 스토리지: S3 + Delta Lake
storage_config = {
    "data_bucket": "s3://company-lakehouse-prod/",
    "checkpoint_bucket": "s3://company-checkpoints-prod/",
    "metastore_bucket": "s3://company-unity-catalog/",
    "encryption": "SSE-KMS",
    "kms_key": "arn:aws:kms:us-east-1:123456789012:key/xxx"
}

# 2. 컴퓨트: EC2 인스턴스 기반 클러스터
cluster_config = {
    "spark_version": "14.3.x-scala2.12",
    "node_type_id": "i3.xlarge",  # 스토리지 최적화
    "driver_node_type_id": "i3.2xlarge",
    "num_workers": 8,
    "autoscale": {"min_workers": 4, "max_workers": 16},
    "aws_attributes": {
        "instance_profile_arn": "arn:aws:iam::123456789012:instance-profile/databricks-role",
        "availability": "SPOT_WITH_FALLBACK",
        "spot_bid_price_percent": 100
    }
}

Azure 환경

# Azure에서의 Databricks 아키텍처
# 1. 스토리지: ADLS Gen2 + Delta Lake
storage_config = {
    "container": "abfss://lakehouse@companystorage.dfs.core.windows.net/",
    "metastore": "abfss://unity-catalog@companystorage.dfs.core.windows.net/",
    "encryption": "Microsoft Managed Keys",
    "network": "Private Endpoint"
}

# 2. 네트워킹: VNet Injection
# Databricks 워크스페이스를 고객 VNet에 직접 배포
# - Private Link로 컨트롤 플레인 접근
# - No Public IP로 클러스터 운영
# - NSG(Network Security Group)로 트래픽 제어

GCP 환경

# GCP에서의 Databricks 아키텍처
# 1. 스토리지: GCS + Delta Lake
storage_config = {
    "bucket": "gs://company-lakehouse-prod/",
    "metastore": "gs://company-unity-catalog/",
    "encryption": "Customer-Managed Encryption Key (CMEK)"
}

# 2. BigQuery와의 연동
# Databricks에서 BigQuery 테이블 직접 조회
bq_df = (
    spark.read
    .format("bigquery")
    .option("table", "project.dataset.table")
    .option("viewsEnabled", "true")
    .load()
)

Terraform으로 Databricks 워크스페이스 프로비저닝

# Terraform으로 Databricks 워크스페이스 + Unity Catalog 설정

provider "databricks" {
  alias = "workspace"
  host  = databricks_workspace.main.workspace_url
}

# 워크스페이스 생성 (AWS 예시)
resource "databricks_workspace" "main" {
  workspace_name = "production-lakehouse"
  region         = "us-east-1"

  aws_config {
    subnet_ids         = var.private_subnet_ids
    security_group_ids = [var.security_group_id]
    instance_profile   = var.instance_profile_arn
  }

  storage_config {
    s3_bucket_name = var.root_bucket_name
  }
}

# Unity Catalog Metastore
resource "databricks_metastore" "main" {
  provider      = databricks.workspace
  name          = "production-metastore"
  storage_root  = "s3://unity-catalog-metastore/"
  force_destroy = false
}

# 클러스터 정책
resource "databricks_cluster_policy" "data_engineering" {
  provider = databricks.workspace
  name     = "Data Engineering Policy"

  definition = jsonencode({
    "spark_version" : { "type" : "fixed", "value" : "14.3.x-scala2.12" },
    "autoscale.max_workers" : { "type" : "range", "maxValue" : 20 },
    "node_type_id" : { "type" : "allowlist", "values" : ["i3.xlarge", "i3.2xlarge"] },
    "custom_tags.team" : { "type" : "fixed", "value" : "data-engineering" }
  })
}

3-8. 고객 대응 역량

FDE는 단순한 기술 전문가가 아니라 고객 대응 전문가이기도 합니다. 기술만큼이나 중요한 소프트 스킬을 살펴봅니다.

Technical Discovery: 고객 데이터 환경 파악

Discovery 프레임워크:

  1. 현재 상태(As-Is) 평가

    • 기존 데이터 인프라: Hadoop, Snowflake, Redshift, Oracle DW 등
    • 데이터 볼륨: 일별 수집량, 총 저장량, 증가율
    • 현재 ETL/ELT 도구: Informatica, Talend, dbt, Airflow 등
    • 데이터 거버넌스 수준: 리니지 추적, 접근 제어, 데이터 품질 관리 현황
  2. 목표 상태(To-Be) 정의

    • Lakehouse 아키텍처로의 마이그레이션 범위
    • 실시간 처리 요구사항
    • AI/ML 파이프라인 목표
    • 비용 최적화 타겟
  3. Gap 분석

    • 기술 역량 갭: 고객 팀의 Spark/Delta Lake 경험
    • 인프라 갭: 클라우드 성숙도, 네트워크 구성
    • 프로세스 갭: CI/CD, 데이터 품질 관리

Architecture Workshop: 솔루션 설계 워크숍

워크숍 구조 (보통 2-3일):

  • Day 1: 현재 아키텍처 리뷰 + Lakehouse 개념 교육
  • Day 2: Medallion Architecture 설계 + 핸즈온 실습
  • Day 3: 마이그레이션 계획 수립 + 로드맵 합의

핵심 산출물:

  • 아키텍처 다이어그램 (As-Is / To-Be)
  • 데이터 흐름도 (Data Flow Diagram)
  • 마이그레이션 우선순위 매트릭스
  • 리소스 계획 (인력, 인프라, 타임라인)

POC 실행 및 성공 기준 정의

POC 성공 기준 예시:

지표기준값측정 방법
ETL 처리 시간기존 대비 50% 단축동일 데이터셋 벤치마크
쿼리 성능P95 지연시간 5초 이내대시보드 쿼리 실행
데이터 품질99.9% 정확도소스 vs 타겟 비교
비용월 운영비 30% 절감클라우드 비용 비교

핸드오프: PS에서 Customer Success로

핸드오프 체크리스트:

  • 아키텍처 문서 완성
  • 운영 런북(Runbook) 작성
  • 모니터링/알림 설정 완료
  • 고객 팀 교육 완료 (최소 2명 이상 자립 가능)
  • 성능 베이스라인 수립
  • 에스컬레이션 경로 정의

4. 면접 예상 질문 25선

Spark 기술 (8문항)

Q1. Spark의 Catalyst Optimizer가 쿼리 성능을 개선하는 주요 메커니즘 3가지를 설명하세요.

모범 답변: Predicate Pushdown(필터 조건을 데이터 소스 레벨로 밀어내려 불필요한 데이터 읽기 최소화), Column Pruning(필요한 컬럼만 선택적으로 읽어 I/O 최소화), Join Reordering(통계 기반으로 조인 순서를 최적화하여 셔플 데이터 최소화)이 있습니다. Catalyst는 Rule-based와 Cost-based 두 가지 최적화 전략을 사용하며, 물리적 계획 단계에서 BroadcastHashJoin, SortMergeJoin 등 최적의 조인 전략을 선택합니다.

Q2. Spark에서 Data Skew(데이터 편향)가 발생했을 때 해결 방법은 무엇인가요?

모범 답변: 주요 해결 방법은 3가지입니다. 첫째, Salting 기법으로 핫키에 랜덤 접미사를 추가하여 파티션을 균등 분배합니다. 둘째, AQE(Adaptive Query Execution)의 skewJoin 기능을 활성화하면 런타임에 자동으로 스큐를 감지하고 큰 파티션을 분할합니다. 셋째, Broadcast Join으로 작은 테이블을 브로드캐스트하여 셔플 자체를 제거합니다.

Q3. PySpark에서 UDF 사용 시 성능 저하가 발생하는 이유와 대안은 무엇인가요?

모범 답변: PySpark UDF는 JVM과 Python 프로세스 간 데이터를 직렬화/역직렬화(SerDe)해야 하므로 오버헤드가 발생합니다. 대안으로는 빌트인 함수(pyspark.sql.functions)를 최대한 활용하거나, Pandas UDF(vectorized UDF)를 사용하면 Apache Arrow 기반으로 배치 단위로 데이터를 전송하여 10-100배 성능 향상이 가능합니다.

Q4. Spark Shuffle이란 무엇이며, 셔플을 줄이기 위한 전략은 무엇인가요?

모범 답변: Shuffle은 Spark에서 파티션 간 데이터 재분배가 필요할 때 발생하는 비용이 큰 연산입니다(groupBy, join, repartition 등). 셔플을 줄이기 위해서는 Broadcast Join으로 작은 테이블의 셔플 제거, 적절한 파티셔닝(co-partitioning), map-side aggregation(reduceByKey vs groupByKey), 그리고 AQE의 파티션 병합 기능을 활용합니다.

Q5. Spark에서 메모리 관리 모델을 설명하고, OOM 에러 해결 방법은 무엇인가요?

모범 답변: Spark는 Unified Memory Manager를 사용하며, Execution Memory(셔플, 조인, 정렬)와 Storage Memory(캐시, 브로드캐스트)가 동적으로 공유됩니다. OOM 해결 방법으로는 드라이버 메모리 증가(spark.driver.memory), 익스큐터 메모리 조정(spark.executor.memory), 파티션 수 증가로 데이터 분산, 브로드캐스트 조인 임계값 조정(spark.sql.autoBroadcastJoinThreshold), persist 레벨 변경(MEMORY_AND_DISK) 등이 있습니다.

Q6. Spark 3.x에서 AQE(Adaptive Query Execution)의 3가지 핵심 기능을 설명하세요.

모범 답변: 첫째, Coalesce Shuffle Partitions로 셔플 후 과도하게 작은 파티션들을 자동 병합합니다. 둘째, Skew Join Optimization으로 런타임에 데이터 스큐를 감지하고 큰 파티션을 분할하여 균등하게 처리합니다. 셋째, Dynamic Join Strategy Switching으로 런타임 통계를 기반으로 Sort-Merge Join에서 Broadcast Hash Join으로 전환합니다.

Q7. Spark에서 Partition Pruning이란 무엇이고, Dynamic Partition Pruning과의 차이는 무엇인가요?

모범 답변: Partition Pruning은 쿼리 필터 조건에 맞는 파티션만 읽어 I/O를 줄이는 최적화입니다. Static Partition Pruning은 컴파일 시점에 필터 값을 알 때 적용됩니다. Dynamic Partition Pruning(DPP)은 Spark 3.0에서 도입되어, 조인 시 한쪽 테이블의 결과를 기반으로 다른 테이블의 파티션을 런타임에 프루닝합니다. 대형 팩트 테이블과 작은 디멘전 테이블 조인 시 큰 효과가 있습니다.

Q8. Spark의 Whole-Stage Code Generation이란 무엇인가요?

모범 답변: Whole-Stage Code Generation은 Tungsten Engine의 핵심 기능으로, 여러 연산자를 단일 Java 메서드로 컴파일하여 가상 함수 호출과 중간 데이터 복사를 제거합니다. 기존에는 각 연산자가 next() 메서드를 호출하며 한 행씩 처리했지만, 코드 제너레이션은 타이트한 루프로 행을 직접 처리하여 CPU 캐시 효율성과 처리 속도를 크게 향상시킵니다.

Delta Lake / Unity Catalog (7문항)

Q9. Delta Lake의 ACID 트랜잭션은 어떻게 구현되나요?

모범 답변: Delta Lake는 트랜잭션 로그(_delta_log/)를 통해 ACID를 구현합니다. 모든 쓰기 연산은 JSON 형태의 커밋 로그를 순차적으로 기록하며, 낙관적 동시성 제어(Optimistic Concurrency Control)를 사용합니다. 충돌 감지 시 자동 재시도하며, 10개 커밋마다 체크포인트 파일을 생성하여 로그 읽기 성능을 유지합니다. 이를 통해 동시 읽기/쓰기, 실패 시 원자적 롤백, 일관된 읽기가 보장됩니다.

Q10. Medallion Architecture에서 각 레이어(Bronze/Silver/Gold)의 역할과 설계 원칙은 무엇인가요?

모범 답변: Bronze는 원본 데이터를 그대로 적재하는 Append-only 레이어로, 데이터 소스의 완전한 히스토리를 보존합니다. Silver는 정제된 데이터로 중복 제거, 스키마 표준화, 데이터 품질 검증을 수행합니다. Gold는 비즈니스 관점의 집계 테이블로, 대시보드와 ML 모델이 직접 소비합니다. 핵심 원칙은 각 레이어가 독립적으로 재처리 가능해야 하며, Bronze에서 Gold로 갈수록 데이터의 비즈니스 가치가 높아진다는 것입니다.

Q11. Delta Lake의 Liquid Clustering과 기존 Z-ORDER의 차이점은 무엇인가요?

모범 답변: Z-ORDER는 수동으로 실행해야 하고 클러스터링 컬럼 변경 시 전체 테이블을 재작성해야 합니다. Liquid Clustering은 OPTIMIZE 실행 시 점진적으로 데이터를 재배치하며, 클러스터링 키를 동적으로 변경할 수 있습니다. 또한 Liquid Clustering은 쿼리 패턴에 따라 자동으로 최적의 클러스터링을 적용하여 유지보수 부담을 크게 줄입니다.

Q12. Unity Catalog의 Row Level Security와 Column Level Security를 구현하는 방법을 설명하세요.

모범 답변: Column Level Security는 마스킹 함수를 정의하여 특정 컬럼의 값을 사용자 그룹에 따라 다르게 표시합니다. IS_ACCOUNT_GROUP_MEMBER 함수로 그룹 멤버십을 확인하여 원본 값 또는 마스킹된 값을 반환합니다. Row Level Security는 행 필터 함수를 테이블에 적용하여 사용자 그룹에 따라 특정 행만 보이도록 합니다. 두 기능 모두 Unity Catalog에서 중앙 관리되므로 모든 접근 경로에서 일관되게 적용됩니다.

Q13. Change Data Feed(CDF)란 무엇이고 어떤 상황에서 사용하나요?

모범 답변: CDF는 Delta 테이블의 변경 내역(INSERT, UPDATE, DELETE)을 별도의 변경 데이터로 추적하는 기능입니다. 주로 CDC(Change Data Capture) 파이프라인에서 변경된 데이터만 다운스트림으로 전파할 때 사용합니다. Silver에서 Gold 테이블로의 증분 업데이트, 감사 로그, 실시간 대시보드 갱신에 효과적입니다. table_changes() 함수로 특정 버전 이후의 변경 사항만 조회할 수 있습니다.

Q14. Unity Catalog에서 데이터 리니지(Lineage)가 왜 중요하고 어떻게 활용하나요?

모범 답변: 데이터 리니지는 데이터의 출처와 변환 과정을 추적하는 것으로, 규제 준수(GDPR의 데이터 처리 기록), 영향 분석(소스 테이블 변경 시 영향 받는 다운스트림 파악), 디버깅(데이터 품질 이슈의 근본 원인 추적)에 필수적입니다. Unity Catalog는 노트북, 잡, 쿼리의 실행을 자동 추적하여 테이블 레벨과 컬럼 레벨의 리니지를 제공합니다.

Q15. UniForm이란 무엇이고 왜 필요한가요?

모범 답변: UniForm은 Delta Lake 테이블을 Apache Iceberg와 Apache Hudi 포맷으로도 자동 노출하는 기능입니다. Databricks 외부 시스템(Snowflake, Trino, Presto 등)에서 동일한 데이터를 각자의 네이티브 포맷으로 읽을 수 있게 해줍니다. 이를 통해 데이터 복사 없이 멀티 엔진 환경을 지원하고, 벤더 종속을 방지합니다.

RAG/AI (5문항)

Q16. RAG 파이프라인의 4단계를 설명하고, 각 단계에서의 최적화 포인트는 무엇인가요?

모범 답변: 1) Chunking: 문서를 적절한 크기로 분할합니다. 청크 크기(500-1500 토큰)와 오버랩(10-20%)이 검색 품질에 큰 영향을 줍니다. 2) Embedding: 텍스트를 벡터로 변환합니다. 도메인에 맞는 임베딩 모델 선택이 중요합니다. 3) Search: 벡터 유사도 검색으로 관련 문서를 찾습니다. 하이브리드 검색(벡터 + 키워드)이 정확도를 높입니다. 4) Generate: LLM이 검색 결과를 컨텍스트로 사용하여 답변을 생성합니다. 프롬프트 엔지니어링과 온도(temperature) 조절이 핵심입니다.

Q17. Databricks의 Vector Search에서 Delta Sync Index의 장점은 무엇인가요?

모범 답변: Delta Sync Index는 Delta 테이블의 변경 사항을 자동으로 벡터 인덱스에 동기화합니다. 장점은 첫째, 별도의 동기화 파이프라인 구축이 불필요합니다. 둘째, CDF 기반으로 변경된 데이터만 증분 인덱싱하여 효율적입니다. 셋째, Unity Catalog의 거버넌스가 벡터 인덱스에도 그대로 적용되어 보안이 일관됩니다. 넷째, 테이블 버전과 인덱스 버전이 동기화되어 데이터 일관성이 보장됩니다.

Q18. Mosaic AI Agent Framework에서 에이전트를 설계할 때 고려할 핵심 요소는 무엇인가요?

모범 답변: 첫째, 도구(Tool) 설계로 에이전트가 사용할 수 있는 도구의 범위와 권한을 명확히 정의해야 합니다. 둘째, 안전 장치(Guardrails)로 에이전트의 행동 범위를 제한하고, 민감한 작업에는 사람의 승인을 요구합니다. 셋째, 평가(Evaluation) 프레임워크로 에이전트의 정확도, 안전성, 지연시간을 지속적으로 측정합니다. 넷째, 관찰 가능성(Observability)으로 에이전트의 추론 과정과 도구 호출을 추적합니다.

Q19. Model Gateway를 사용하는 이점은 무엇인가요?

모범 답변: Model Gateway는 여러 LLM 프로바이더(OpenAI, Anthropic, 오픈소스 모델)를 단일 인터페이스로 통합합니다. 이점으로는 첫째, API 키 관리의 중앙화로 보안 강화. 둘째, 모델 간 전환이 코드 변경 없이 설정만으로 가능. 셋째, 비용 추적과 사용량 모니터링의 통합. 넷째, 레이트 리밋과 폴백(fallback) 전략의 중앙 관리. 다섯째, Unity Catalog의 거버넌스가 LLM 호출에도 적용됩니다.

Q20. RAG 시스템에서 환각(Hallucination)을 줄이기 위한 전략은 무엇인가요?

모범 답변: 첫째, 검색 품질 개선으로 하이브리드 검색(벡터 + BM25), Reranking 모델 적용, 메타데이터 필터링을 통해 관련성 높은 컨텍스트를 제공합니다. 둘째, 프롬프트 엔지니어링으로 "제공된 컨텍스트에만 기반하여 답변하세요"와 같은 지시를 추가합니다. 셋째, 출처 표시(Citation)를 강제하여 LLM이 답변의 근거를 명시하게 합니다. 넷째, 답변 검증 파이프라인으로 생성된 답변이 소스 문서와 일치하는지 자동 검증합니다.

고객 시나리오 (5문항)

Q21. 고객이 Hadoop에서 Databricks로 마이그레이션하려 합니다. 어떤 접근 방법을 제안하시겠습니까?

모범 답변: 단계적 마이그레이션을 제안합니다. 1단계: 데이터 레이크 마이그레이션으로 HDFS 데이터를 S3/ADLS로 이동하고 Delta Lake로 변환합니다. 2단계: ETL 파이프라인 마이그레이션으로 Hive/Pig 잡을 Spark/Delta Live Tables로 변환합니다. 3단계: 분석 워크로드 마이그레이션으로 Hive 쿼리를 Spark SQL로 변환합니다. 전체 마이그레이션 동안 두 시스템을 병행 운영하여 리스크를 최소화하며, 각 단계마다 데이터 정합성 검증을 수행합니다.

Q22. POC에서 고객이 기대하는 성능을 달성하지 못했을 때 어떻게 대응하시겠습니까?

모범 답변: 먼저 성능 병목 지점을 정확히 분석합니다. Spark UI에서 Stage별 실행 시간, 셔플 데이터량, 스큐 발생 여부를 확인합니다. 그 다음 최적화를 시도합니다. 파티셔닝 전략 변경, 캐싱, 브로드캐스트 조인, AQE 활성화 등. 만약 데이터 특성상 목표 달성이 어렵다면 고객에게 투명하게 공유하고, 달성 가능한 현실적 수치와 추가 최적화 로드맵을 제시합니다.

Q23. 고객의 데이터 엔지니어가 Spark에 익숙하지 않습니다. 어떻게 기술 전수하시겠습니까?

모범 답변: 3단계 교육 전략을 사용합니다. 1단계 Hands-on Workshop(1주): 실제 고객 데이터로 기본 ETL 파이프라인을 함께 구축합니다. 2단계 Pair Programming(2-4주): 고객 엔지니어와 페어 프로그래밍으로 실전 프로젝트를 진행하며, 점진적으로 주도권을 이전합니다. 3단계 Self-service(이후): 문서화된 베스트 프랙티스, 템플릿 노트북, 트러블슈팅 가이드를 제공하고, 주간 오피스 아워로 지원합니다.

Q24. 고객이 비용 최적화를 요청합니다. 어떤 분석과 개선을 제안하시겠습니까?

모범 답변: 먼저 비용 분석 대시보드를 구축합니다. 클러스터별, 워크로드별, 팀별 비용을 시각화합니다. 주요 최적화 포인트는: 첫째, Spot 인스턴스 활용으로 40-90% 비용 절감. 둘째, 자동 종료 정책으로 미사용 클러스터 비용 제거. 셋째, 클러스터 풀링으로 시작 시간 단축과 리소스 공유. 넷째, Delta Lake의 OPTIMIZE와 VACUUM으로 스토리지 비용 절감. 다섯째, 잡 클러스터로 인터랙티브 클러스터 대비 비용 최적화. 보통 30-50% 비용 절감이 가능합니다.

Q25. 금융 기관 고객이 데이터 거버넌스와 규제 준수(GDPR, SOX)를 최우선으로 요구합니다. 어떻게 설계하시겠습니까?

모범 답변: Unity Catalog를 중심으로 거버넌스 프레임워크를 구축합니다. GDPR 대응: 개인정보(PII) 컬럼에 마스킹 함수 적용, 데이터 리니지 추적으로 처리 기록 유지, 삭제 요청(Right to Erasure) 대응을 위한 Delta Lake의 DELETE + VACUUM 프로세스. SOX 대응: Row Level Security로 재무 데이터 접근 통제, 감사 로그를 통한 모든 데이터 접근 기록, 변경 이력을 Delta Lake의 Time Travel로 보존. 추가로 데이터 분류 태깅, 보존 정책, 암호화(저장 시/전송 시)를 적용합니다.


5. 8개월 학습 로드맵

주제목표
1-2월Apache Spark 기초-중급PySpark DataFrame API 숙달, Spark SQL, 기본 최적화
2-3월Delta Lake 및 LakehouseMedallion Architecture 구현, ACID/Time Travel 실습
3-4월Unity Catalog 및 Governance3레벨 네임스페이스, 접근 제어, 리니지 추적
4-5월MLflow 및 Feature Engineering실험 추적, 모델 레지스트리, Feature Store 활용
5-6월Mosaic AI (RAG/Agents)Vector Search, RAG 파이프라인, Agent Framework
6-7월클라우드 인프라 및 TerraformAWS/Azure에서 Databricks 프로비저닝, IaC
7-8월고객 시나리오 및 모의 면접POC 시뮬레이션, 아키텍처 설계, 프레젠테이션 연습
8월자격증 및 최종 준비Databricks Certified Data Engineer Associate 취득

월별 세부 가이드:

1-2월: Spark 마스터리

  • Databricks Community Edition(무료) 가입
  • PySpark DataFrame API를 실제 데이터셋으로 연습
  • Spark UI 읽기 능력 배양: Stage, Task, Shuffle 분석
  • 최적화 연습: broadcast join, partition pruning, AQE

3-4월: Delta Lake + Unity Catalog

  • Delta Lake Quickstart로 CRUD, Time Travel 실습
  • Medallion Architecture를 E-commerce 데이터셋으로 구현
  • Unity Catalog에서 카탈로그/스키마/테이블 생성 및 권한 관리
  • Row/Column Level Security 실습

5-6월: AI/ML 파이프라인

  • MLflow로 모델 실험 추적 및 레지스트리 사용
  • RAG 파이프라인을 PDF 문서로 구축
  • Vector Search Index 생성 및 유사도 검색 구현
  • Model Serving Endpoint 배포

7-8월: 통합 프로젝트 및 면접 준비

  • End-to-end 프로젝트 구축 (아래 포트폴리오 참조)
  • 고객 시나리오 역할극 연습
  • Databricks 자격증 취득
  • 모의 면접 5회 이상 실시

6. 자격증 가이드

Databricks Certified Data Engineer Associate

  • 난이도: 중간
  • 범위: Spark, Delta Lake, ETL, Lakehouse 기본 개념
  • 형식: 45문항, 90분, 합격선 70%
  • 추천 준비 기간: 4-6주
  • 핵심: Databricks 환경에서의 데이터 엔지니어링 기초

Databricks Certified Machine Learning Associate

  • 난이도: 중간
  • 범위: MLflow, Feature Store, AutoML, 모델 서빙
  • 형식: 45문항, 90분, 합격선 70%
  • 추천 준비 기간: 4-6주
  • 핵심: Databricks 환경에서의 ML 라이프사이클 관리

Databricks Certified Data Engineer Professional

  • 난이도: 상
  • 범위: 고급 ETL, 성능 최적화, 프로덕션 파이프라인, Delta Live Tables
  • 형식: 60문항, 120분, 합격선 70%
  • 추천 준비 기간: 8-12주
  • 핵심: 대규모 프로덕션 환경의 데이터 엔지니어링 전문성

Databricks Generative AI Engineer Associate (2025년 신설)

  • 난이도: 중상
  • 범위: RAG, Vector Search, Mosaic AI, Agent Framework, Model Gateway
  • 형식: 45문항, 90분, 합격선 70%
  • 추천 준비 기간: 6-8주
  • 핵심: Databricks 환경에서의 Gen AI 애플리케이션 구축

취득 순서 추천: Data Engineer Associate 먼저 취득 후 ML Associate 또는 Gen AI Associate를 추가 취득하면 FDE 포지션에 강력한 어필이 됩니다.


7. 포트폴리오 프로젝트 3개

프로젝트 1: E-commerce Lakehouse (Medallion Architecture)

목표: 실제 이커머스 데이터로 Bronze/Silver/Gold 파이프라인 구축

기술 스택: PySpark, Delta Lake, DLT, Unity Catalog, Auto Loader

구현 내용:

  • Bronze: Auto Loader로 JSON 이벤트 데이터 실시간 수집
  • Silver: 데이터 품질 검증(DLT Expectations), 중복 제거, 스키마 표준화
  • Gold: 고객별 RFM(Recency, Frequency, Monetary) 분석, 일별 매출 집계
  • Unity Catalog로 데이터 거버넌스 설정: PII 마스킹, 팀별 접근 제어

프로젝트 2: Customer Support RAG 챗봇

목표: 사내 문서 기반 고객 지원 챗봇 구축

기술 스택: Vector Search, Mosaic AI, LangChain, MLflow, Model Serving

구현 내용:

  • 제품 매뉴얼, FAQ, 기술 문서를 청킹 및 임베딩
  • Delta Sync Index로 문서 업데이트 자동 반영
  • Mosaic AI Agent Framework으로 에이전트 구축
  • MLflow로 RAG 품질 평가(faithfulness, relevance, groundedness)
  • Model Serving Endpoint로 프로덕션 배포

프로젝트 3: 실시간 이상 감지 파이프라인

목표: IoT 센서 데이터의 실시간 이상 감지

기술 스택: Spark Structured Streaming, Delta Lake, MLflow, Model Serving

구현 내용:

  • Kafka에서 센서 데이터를 Structured Streaming으로 수집
  • 윈도우 기반 통계(이동 평균, 표준 편차)로 이상 감지
  • MLflow로 학습된 Isolation Forest 모델을 실시간 추론
  • 이상 감지 시 Slack/PagerDuty 알림 발송
  • 대시보드에서 실시간 모니터링

8. 퀴즈

배운 내용을 점검해봅시다.

Q1. Databricks의 Lakehouse Architecture란 무엇이며, 기존 Data Lake와 Data Warehouse의 어떤 한계를 해결하나요?

A: Lakehouse Architecture는 Data Lake의 유연성(비정형 데이터 저장, 저비용 스토리지)과 Data Warehouse의 안정성(ACID 트랜잭션, 스키마 관리, 성능)을 결합한 통합 플랫폼입니다. Data Lake의 한계인 데이터 품질 관리 부재, 트랜잭션 미지원, 메타데이터 관리 미흡을 해결하고, Data Warehouse의 한계인 비정형 데이터 처리 불가, 높은 비용, ML 워크로드 미지원을 해결합니다. Delta Lake가 스토리지 레이어로, Unity Catalog가 거버넌스 레이어로 Lakehouse의 핵심을 구성합니다.

Q2. Spark에서 AQE(Adaptive Query Execution)를 활성화하면 어떤 문제들이 자동으로 최적화되나요?

A: AQE가 해결하는 3가지 핵심 문제는 다음과 같습니다. 첫째, 과도한 셔플 파티션 문제: 셔플 후 작은 파티션들을 자동 병합(Coalesce)하여 태스크 수를 줄입니다. 둘째, 데이터 스큐(Skew) 문제: 런타임에 스큐를 감지하고 큰 파티션을 자동 분할하여 균등 처리합니다. 셋째, 조인 전략 비효율: 런타임 통계를 기반으로 Sort-Merge Join에서 Broadcast Hash Join으로 자동 전환합니다. 이 모든 최적화는 코드 변경 없이 설정만으로 적용됩니다.

Q3. Unity Catalog의 3레벨 네임스페이스(catalog.schema.table) 구조가 데이터 거버넌스에 왜 중요한가요?

A: 3레벨 네임스페이스는 조직의 데이터 자산을 체계적으로 분류하고 접근을 세밀하게 제어할 수 있게 합니다. Catalog 레벨로 환경(production/development)이나 도메인(finance/marketing)을 분리하고, Schema 레벨로 데이터 주제 영역을 구분하며, Table 레벨로 개별 데이터셋을 관리합니다. 각 레벨에서 독립적인 권한 설정이 가능하여 최소 권한 원칙을 적용할 수 있고, 크로스 카탈로그 조인도 지원하면서 데이터 리니지가 자동 추적됩니다.

Q4. RAG 파이프라인에서 청크 크기(chunk size)와 오버랩(overlap)이 검색 품질에 미치는 영향은 무엇인가요?

A: 청크 크기가 너무 작으면 문맥 정보가 부족하여 검색 결과의 의미가 불완전할 수 있고, 너무 크면 노이즈가 많이 포함되어 관련성이 떨어집니다. 일반적으로 500-1500 토큰이 적절합니다. 오버랩은 청크 경계에서 정보가 단절되는 것을 방지합니다. 10-20% 오버랩이 일반적이며, 오버랩이 없으면 문장이 중간에 잘려 의미를 잃을 수 있습니다. 최적 값은 문서 특성에 따라 다르므로 실험을 통해 결정해야 합니다.

Q5. FDE가 POC 프로젝트에서 성능 목표를 달성하지 못했을 때, 어떤 단계로 문제를 분석하고 대응해야 하나요?

A: 체계적인 분석이 필요합니다. 1단계 진단: Spark UI에서 Stage별 실행 시간, 셔플 데이터량, 스큐 여부, GC 시간을 분석합니다. 2단계 최적화: 파티셔닝 전략 변경, 브로드캐스트 조인 적용, AQE 활성화, 캐싱 전략, 클러스터 사이즈 조정을 시도합니다. 3단계 소통: 최적화 결과와 현실적인 달성 가능 수치를 고객에게 투명하게 공유합니다. 추가 최적화 로드맵을 제시하고, 필요시 아키텍처 레벨 변경(예: 배치에서 스트리밍 전환)을 제안합니다. 핵심은 문제를 숨기지 않고 데이터 기반으로 소통하는 것입니다.


9. 참고 자료

공식 문서

  1. Databricks 공식 문서 - docs.databricks.com - Databricks 플랫폼 전체 레퍼런스
  2. Apache Spark 공식 문서 - spark.apache.org/docs - Spark API 및 가이드
  3. Delta Lake 공식 문서 - docs.delta.io - Delta Lake 오픈소스 문서
  4. MLflow 공식 문서 - mlflow.org/docs - MLflow API 및 가이드

자격증 준비

  1. Databricks Academy - academy.databricks.com - 무료/유료 교육 과정
  2. Data Engineer Associate 시험 가이드 - databricks.com/learn/certification
  3. Gen AI Engineer Associate 시험 가이드 - databricks.com/learn/certification
  4. Databricks Community Edition - community.cloud.databricks.com - 무료 실습 환경

학습 리소스

  1. Learning Spark, 2nd Edition - Jules Damji 외 저, Spark 바이블
  2. Delta Lake: The Definitive Guide - O'Reilly, Delta Lake 공식 가이드북
  3. Databricks Blog - databricks.com/blog - 최신 기술 업데이트와 사례
  4. Data + AI Summit 영상 - databricks.com/dataaisummit - 연간 컨퍼런스 세션

업계 동향

  1. Databricks IPO 관련 뉴스 - Bloomberg, Reuters 등에서 추적 가능
  2. Lakehouse 아키텍처 논문 - "Lakehouse: A New Generation of Open Platforms"
  3. Gartner Magic Quadrant for Cloud DBMS - 시장 포지셔닝 분석

커뮤니티

  1. Databricks Community Forum - community.databricks.com
  2. r/databricks - reddit.com/r/databricks - 커뮤니티 Q&A
  3. Databricks Slack - 공식 슬랙 채널에서 엔지니어와 직접 소통

마무리

Databricks의 AI Engineer (FDE) 포지션은 AI 시대의 가장 흥미로운 역할 중 하나입니다. 단순히 코드를 작성하는 것이 아니라, 세계 최고 수준의 Lakehouse 기술을 엔터프라이즈 고객에게 직접 전달하는 역할입니다.

이 가이드에서 다룬 내용을 요약하면:

  • Databricks는 620억 달러 기업가치의 Lakehouse 발명 기업이며, FDE는 고객 현장 핵심 팀
  • Spark, Delta Lake, Unity Catalog, Mosaic AI가 기술적 핵심 스택
  • Medallion Architecture와 RAG 파이프라인 구축 능력이 차별화 요소
  • 8개월의 체계적 학습과 3개 포트폴리오 프로젝트로 준비 가능
  • 고객 대응 역량이 기술만큼 중요

이 로드맵을 따라 체계적으로 준비한다면, Databricks FDE로서의 커리어를 시작하는 데 확실한 기반이 될 것입니다. Lakehouse와 AI의 교차점에 있는 이 분야는 빠르게 성장하고 있고, 이 역량을 갖춘 엔지니어에 대한 수요는 계속 늘어날 것입니다.

화이팅하세요!

Databricks AI Engineer (FDE) Complete Guide: Spark, Unity Catalog, RAG to Customer Deployment

1. Understanding Databricks and the FDE Team

What Is Databricks

Databricks is a data + AI platform company born from UC Berkeley's AMPLab in 2013. Co-founded by the creators of Apache Spark (Ali Ghodsi, Matei Zaharia, and others), the company is valued at approximately 62 billion dollars as of 2024, making it one of the most valuable private AI companies in the world.

Key Innovations by Databricks:

  • Created Apache Spark: The distributed computing framework that became the de facto standard for big data processing
  • Invented Lakehouse Architecture: A next-generation architecture combining the flexibility of Data Lakes with the reliability of Data Warehouses
  • Open-sourced Delta Lake: A storage layer supporting ACID transactions
  • Unity Catalog: A governance platform for unified management of data, AI models, and features
  • Mosaic AI: An integrated AI/ML platform brand following the 2024 acquisition of MosaicML

Company Scale and Growth:

  • ARR (Annual Recurring Revenue) approximately 1.6 billion dollars (2024)
  • Over 10,000 customers, with more than 60% of Fortune 500 companies using the platform
  • 7,000+ employees across 30+ offices worldwide
  • The only Lakehouse platform operating across all three clouds: AWS, Azure, and GCP

What Is the FDE (Forward Deployed Engineer) Team

The FDE team at Databricks is a core engineering team within the Professional Services organization. They work directly at customer sites to build, optimize, and solve the most complex data/AI challenges on the Databricks platform.

Core Mission of FDEs:

  • Migrate enterprise customers' data platforms to the Databricks Lakehouse
  • Build customized RAG/AI pipelines tailored to customer environments
  • Performance optimization: Spark job tuning, cost optimization, architecture improvements
  • Knowledge transfer: Building the capabilities of customer engineering teams

FDE vs Field Engineer vs Solutions Architect

These three roles are often confused, but their responsibilities and nature differ significantly.

CategoryFDE (Forward Deployed Engineer)Field EngineerSolutions Architect
Primary ActivityWriting code and implementing directly at customer sitesPre-sales technical demos and POCsArchitecture design and technical advisory
Coding Ratio70-80%30-40%10-20%
Customer ContactClose collaboration with implementation teamsDecision-makers and technical leadersC-level and architects
Project Duration2-6 months long-term1-4 weeks short-termSpot advisory
Success MetricsProject success rate, customer satisfactionPipeline contribution, technical approvalDeal close contribution

Compensation Package

Databricks FDEs receive highly competitive compensation in the industry.

2025 Total Compensation (TC) Range:

  • Junior FDE (0-2 years): approximately 180K-230K dollars
  • Mid-level FDE (3-5 years): approximately 230K-350K dollars
  • Senior FDE (5+ years): approximately 350K-486K+ dollars
  • Average FDE TC: approximately 238K dollars

Compensation Structure:

  • Base salary: approximately 50-60% of TC
  • RSU (Restricted Stock Units): approximately 30-40% of TC (pre-IPO stock with significant upside potential at listing)
  • Annual bonus: approximately 10-15% of TC
  • Additional benefits: travel allowance, learning stipend (5,000 dollars/year), health insurance, 401(k) matching

2. Detailed JD (Job Description) Analysis

Core Responsibilities

Breaking down the Databricks FDE JD, it falls into four main categories.

1. Customer Data Platform Construction

  • Migrate customers' existing data infrastructure (Hadoop, Snowflake, legacy DW) to the Databricks Lakehouse
  • Design and implement Medallion Architecture (Bronze/Silver/Gold)
  • ETL/ELT pipeline optimization

2. RAG/AI Pipeline Implementation

  • Build RAG pipelines using Mosaic AI
  • Design and optimize Vector Search Indexes
  • Deploy and monitor Model Serving Endpoints
  • Implement AI Agents customized to customer data

3. Technical Leadership

  • Conduct technical workshops with customer engineering teams
  • Architecture reviews and best practices transfer
  • Design and execute POCs (Proof of Concept)

4. Project Management

  • Establish implementation timelines and manage milestones
  • Identify and mitigate technical risks
  • Handoff from PS (Professional Services) to Customer Success team

Required Qualifications

  • Apache Spark: Core of distributed data processing. Proficiency in PySpark or Scala Spark
  • Python/Scala: Primary languages for data engineering and ML pipeline development
  • SQL: Writing complex analytical queries, performance optimization, Spark SQL
  • Cloud Platforms: Deep experience with at least one of AWS, Azure, or GCP. Multi-cloud preferred
  • Data Modeling: Star Schema, Snowflake Schema, denormalization strategies
  • Customer-facing Experience: Technical consulting or Professional Services background

Preferred Qualifications

  • Delta Lake: Hands-on experience with ACID transactions, Time Travel, Schema Evolution
  • MLflow: Experiment tracking, model registry, model serving experience
  • Unity Catalog: Data governance, lineage tracking, access control experience
  • Terraform/Pulumi: IaC provisioning of Databricks workspaces
  • Streaming: Spark Structured Streaming, Kafka, Event Hubs experience
  • ML/AI: Feature engineering, model training/deployment, RAG pipeline construction

3. Technical Deep Dive

3-1. Apache Spark Mastery

Apache Spark is the technical foundation of Databricks. As an FDE, you need to deeply understand the internal workings, not just know how to use it.

Evolution from RDD to DataFrame to Dataset

# RDD (2014) - Low-level API, type-safe but hard to optimize
rdd = sc.parallelize([1, 2, 3, 4, 5])
result = rdd.filter(lambda x: x > 2).map(lambda x: x * 2).collect()

# DataFrame (2015) - SQL-friendly, leverages Catalyst Optimizer
df = spark.read.parquet("s3://data/events/")
result = df.filter(df.age > 25).groupBy("city").count()

# Dataset (Scala only) - DataFrame + compile-time type safety
# In Python, DataFrame is equivalent to Dataset[Row]

Catalyst Optimizer and Tungsten Engine

Spark SQL performance depends on the Catalyst Optimizer and Tungsten Engine.

# How to inspect Catalyst optimization stages
df = spark.read.parquet("s3://data/sales/")
optimized = df.filter("amount > 1000").join(
    spark.read.parquet("s3://data/customers/"),
    "customer_id"
)

# View logical/physical execution plans
optimized.explain(True)

# Output example:
# == Parsed Logical Plan ==
# == Analyzed Logical Plan ==
# == Optimized Logical Plan ==   <-- Predicate Pushdown, Column Pruning applied
# == Physical Plan ==             <-- Join strategy (BroadcastHashJoin, etc.) determined

Key Catalyst Optimizations:

  • Predicate Pushdown: Pushes filter conditions to the data source level to minimize unnecessary data reads
  • Column Pruning: Reads only required columns to minimize I/O
  • Constant Folding: Evaluates constant expressions at compile time
  • Join Reordering: Optimizes join order to minimize shuffle data

Role of Tungsten Engine:

  • Off-heap memory management reduces GC overhead
  • Code generation (Whole-Stage CodeGen) eliminates virtual function calls
  • Cache-friendly data structures

Partitioning, Shuffle Optimization, and AQE

# Partitioning strategies - optimization based on data distribution
# 1. Hash Partitioning (default)
df.repartition(200, "customer_id")

# 2. Range Partitioning - good for sorted data
df.repartitionByRange(200, "event_date")

# 3. Shuffle optimization - using broadcast join
from pyspark.sql.functions import broadcast

# Broadcast small table (under 10MB) to eliminate shuffle
result = large_df.join(broadcast(small_df), "key")

# 4. Salting - solving data skew
from pyspark.sql.functions import concat, lit, rand, floor

# Add salt to hot keys for even distribution
salt_range = 10
skewed_df = skewed_df.withColumn(
    "salted_key",
    concat("key", lit("_"), floor(rand() * salt_range).cast("string"))
)

# AQE (Adaptive Query Execution) - Spark 3.0+
# spark.conf settings
spark.conf.set("spark.sql.adaptive.enabled", "true")
spark.conf.set("spark.sql.adaptive.coalescePartitions.enabled", "true")
spark.conf.set("spark.sql.adaptive.skewJoin.enabled", "true")

Key AQE Features:

  • Coalesce Shuffle Partitions: automatically merges small partitions after shuffle
  • Skew Join Optimization: automatically detects and splits skewed partitions at runtime
  • Dynamic Join Strategy Switching: switches from Sort-Merge Join to Broadcast Hash Join at runtime

PySpark vs Scala Spark

# PySpark - advantageous for collaboration with data scientists
from pyspark.sql import SparkSession
from pyspark.sql.functions import col, when, sum as spark_sum

spark = SparkSession.builder.appName("etl").getOrCreate()

df = (
    spark.read.format("delta")
    .load("s3://lakehouse/bronze/events")
    .filter(col("event_date") >= "2025-01-01")
    .withColumn("category",
        when(col("amount") > 1000, "high")
        .when(col("amount") > 100, "medium")
        .otherwise("low")
    )
    .groupBy("category")
    .agg(spark_sum("amount").alias("total_amount"))
)
// Scala Spark - type safety, better performance
import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.functions._

val spark = SparkSession.builder.appName("etl").getOrCreate()
import spark.implicits._

val df = spark.read.format("delta")
  .load("s3://lakehouse/bronze/events")
  .filter($"event_date" >= "2025-01-01")
  .withColumn("category",
    when($"amount" > 1000, "high")
    .when($"amount" > 100, "medium")
    .otherwise("low")
  )
  .groupBy("category")
  .agg(sum("amount").alias("total_amount"))

Selection Criteria:

  • PySpark: ML/AI pipelines, data science team collaboration, prototyping
  • Scala Spark: Performance-critical ETL, streaming pipelines, library development

3-2. Delta Lake and Medallion Architecture

ACID Transactions and Time Travel

Delta Lake adds a transaction log (_delta_log/) on top of Parquet to guarantee ACID compliance.

# Delta Lake basic CRUD operations
# 1. Create table
df.write.format("delta").mode("overwrite").saveAsTable("lakehouse.bronze.raw_events")

# 2. Update (MERGE/UPSERT)
from delta.tables import DeltaTable

target = DeltaTable.forName(spark, "lakehouse.silver.customers")
source = spark.read.format("delta").load("s3://staging/new_customers/")

target.alias("t").merge(
    source.alias("s"),
    "t.customer_id = s.customer_id"
).whenMatchedUpdate(set={
    "name": "s.name",
    "email": "s.email",
    "updated_at": "current_timestamp()"
}).whenNotMatchedInsertAll().execute()

# 3. Time Travel - query past versions
df_v5 = spark.read.format("delta").option("versionAsOf", 5).load(path)
df_yesterday = spark.read.format("delta").option("timestampAsOf", "2025-03-22").load(path)

# 4. RESTORE - restore table to a past version
spark.sql("RESTORE TABLE lakehouse.silver.customers VERSION AS OF 5")

Medallion Architecture Implementation

# Bronze Layer - raw data as-is (append-only)
raw_df = (
    spark.readStream
    .format("cloudFiles")  # Auto Loader
    .option("cloudFiles.format", "json")
    .option("cloudFiles.schemaLocation", "s3://schema/bronze/events/")
    .load("s3://raw-data/events/")
)

bronze_df = raw_df.withColumn("_ingested_at", current_timestamp())

bronze_df.writeStream \
    .format("delta") \
    .outputMode("append") \
    .option("checkpointLocation", "s3://checkpoints/bronze/events/") \
    .trigger(availableNow=True) \
    .toTable("lakehouse.bronze.raw_events")

# Silver Layer - cleansed data (dedup, cleansing, type casting)
silver_df = (
    spark.readStream.table("lakehouse.bronze.raw_events")
    .dropDuplicates(["event_id"])
    .filter(col("event_type").isNotNull())
    .withColumn("amount", col("amount").cast("decimal(18,2)"))
    .withColumn("event_date", to_date(col("event_timestamp")))
)

silver_df.writeStream \
    .format("delta") \
    .outputMode("append") \
    .option("checkpointLocation", "s3://checkpoints/silver/events/") \
    .trigger(availableNow=True) \
    .toTable("lakehouse.silver.clean_events")

# Gold Layer - business aggregate tables
gold_df = (
    spark.read.table("lakehouse.silver.clean_events")
    .groupBy("customer_id", "event_date")
    .agg(
        count("*").alias("event_count"),
        spark_sum("amount").alias("daily_total"),
        avg("amount").alias("avg_amount")
    )
)

gold_df.write.format("delta").mode("overwrite") \
    .saveAsTable("lakehouse.gold.customer_daily_summary")

Change Data Feed (CDF)

-- Enable CDF
ALTER TABLE lakehouse.silver.customers SET TBLPROPERTIES (delta.enableChangeDataFeed = true);

-- Query CDF: extract only changed records
SELECT * FROM table_changes('lakehouse.silver.customers', 5)
WHERE _change_type IN ('insert', 'update_postimage');

Delta Lake 4.0 New Features

  • Liquid Clustering: Automatic clustering that replaces Z-ORDER. Dynamically reorganizes data based on query patterns
  • UniForm: Automatic conversion between Delta, Iceberg, and Hudi formats. Maximizes compatibility with external systems
  • Deletion Vectors: Marks deletions with vectors instead of file rewrites for improved performance on bulk deletes
  • Row Tracking: Row-level change tracking to simplify CDC pipelines
-- Liquid Clustering setup
CREATE TABLE lakehouse.silver.events
CLUSTER BY (event_date, customer_id)
AS SELECT * FROM lakehouse.bronze.raw_events;

-- OPTIMIZE automatically applies optimal clustering
OPTIMIZE lakehouse.silver.events;

3-3. Unity Catalog and Data Governance

3-Level Namespace

Unity Catalog uses a 3-level namespace in the form of catalog.schema.table.

-- Create catalogs
CREATE CATALOG production;
CREATE CATALOG development;

-- Create schemas (databases)
CREATE SCHEMA production.finance;
CREATE SCHEMA production.marketing;

-- Table reference
SELECT * FROM production.finance.transactions
WHERE transaction_date >= '2025-01-01';

-- Cross-catalog join
SELECT a.*, b.segment
FROM production.finance.transactions a
JOIN production.marketing.customer_segments b
ON a.customer_id = b.customer_id;

Data Lineage Tracking

Unity Catalog automatically tracks data lineage, visualizing which tables came from which sources and which notebooks/jobs transformed the data.

# Lineage is automatically tracked, no extra code needed
# Can be viewed in UI or queried via REST API

# Query lineage via Unity Catalog REST API
import requests

response = requests.get(
    "https://workspace.cloud.databricks.com/api/2.1/unity-catalog/lineage/table-lineage",
    headers=headers,
    params={"table_name": "production.finance.transactions"}
)

Row/Column Level Security

-- Column Level Security: define masking function
CREATE FUNCTION production.finance.mask_ssn(ssn STRING)
RETURNS STRING
RETURN CASE
    WHEN IS_ACCOUNT_GROUP_MEMBER('finance_admins') THEN ssn
    ELSE CONCAT('***-**-', RIGHT(ssn, 4))
END;

-- Apply masking function to column
ALTER TABLE production.finance.customers
ALTER COLUMN ssn SET MASK production.finance.mask_ssn;

-- Row Level Security: define row filter function
CREATE FUNCTION production.finance.region_filter(region STRING)
RETURNS BOOLEAN
RETURN CASE
    WHEN IS_ACCOUNT_GROUP_MEMBER('global_admins') THEN TRUE
    WHEN IS_ACCOUNT_GROUP_MEMBER('apac_team') AND region = 'APAC' THEN TRUE
    ELSE FALSE
END;

ALTER TABLE production.finance.transactions
SET ROW FILTER production.finance.region_filter ON (region);

Attribute-based Access Control

-- Tag-based access control
ALTER TABLE production.finance.transactions SET TAGS ('pii' = 'true', 'classification' = 'confidential');

-- Tag-based policy
GRANT SELECT ON TABLE production.finance.transactions
TO `data_analysts`
WHERE TAGS('classification') != 'confidential';

3-4. MLflow on Databricks

Experiment Tracking and Model Registry

import mlflow
from mlflow.tracking import MlflowClient

# Create experiment and run
mlflow.set_experiment("/Shared/customer-churn-prediction")

with mlflow.start_run(run_name="xgboost_v2") as run:
    # Log hyperparameters
    mlflow.log_param("max_depth", 6)
    mlflow.log_param("learning_rate", 0.1)
    mlflow.log_param("n_estimators", 200)

    # Train model
    model = xgb.XGBClassifier(max_depth=6, learning_rate=0.1, n_estimators=200)
    model.fit(X_train, y_train)

    # Log metrics
    predictions = model.predict(X_test)
    accuracy = accuracy_score(y_test, predictions)
    mlflow.log_metric("accuracy", accuracy)
    mlflow.log_metric("f1_score", f1_score(y_test, predictions))

    # Log model artifact
    mlflow.xgboost.log_model(model, "model")

    # Register model in Unity Catalog
    mlflow.register_model(
        f"runs:/{run.info.run_id}/model",
        "production.ml_models.churn_predictor"
    )

Feature Store Integration

from databricks.feature_engineering import FeatureEngineeringClient

fe = FeatureEngineeringClient()

# Create feature table
fe.create_table(
    name="production.features.customer_features",
    primary_keys=["customer_id"],
    timestamp_keys=["event_date"],
    df=customer_features_df,
    description="Customer behavior features: recent purchase frequency, average spend, days since last login"
)

# Create training data with feature lookups
from databricks.feature_engineering import FeatureLookup

training_set = fe.create_training_set(
    df=label_df,
    feature_lookups=[
        FeatureLookup(
            table_name="production.features.customer_features",
            lookup_key="customer_id",
            timestamp_lookup_key="event_date"
        )
    ],
    label="churned"
)

training_df = training_set.load_df()

Autologging

# Enable autologging - automatically track hyperparameters, metrics, and models
mlflow.autolog()

# All subsequent training is automatically logged to MLflow
from sklearn.ensemble import RandomForestClassifier
model = RandomForestClassifier(n_estimators=100, max_depth=10)
model.fit(X_train, y_train)
# Automatically logged: params, metrics, model artifact, feature importance, etc.

Model Serving Endpoint Deployment

import requests
import json

# Create Model Serving Endpoint (REST API)
endpoint_config = {
    "name": "churn-predictor-endpoint",
    "config": {
        "served_entities": [{
            "entity_name": "production.ml_models.churn_predictor",
            "entity_version": "3",
            "workload_size": "Small",
            "scale_to_zero_enabled": True
        }],
        "auto_capture_config": {
            "catalog_name": "production",
            "schema_name": "ml_monitoring",
            "table_name_prefix": "churn_predictor"
        }
    }
}

# Send inference request to endpoint
response = requests.post(
    "https://workspace.cloud.databricks.com/serving-endpoints/churn-predictor-endpoint/invocations",
    headers=headers,
    json={"dataframe_records": [{"customer_id": "C001", "purchase_count": 12, "avg_amount": 150.0}]}
)

3-5. Mosaic AI (RAG and Agents)

Vector Search Index Creation

from databricks.vector_search.client import VectorSearchClient

vsc = VectorSearchClient()

# Create Vector Search endpoint
vsc.create_endpoint(name="rag-endpoint", endpoint_type="STANDARD")

# Create Delta Sync Index - auto-syncs when Delta table changes
vsc.create_delta_sync_index(
    endpoint_name="rag-endpoint",
    index_name="production.rag.document_index",
    source_table_name="production.rag.documents",
    pipeline_type="TRIGGERED",
    primary_key="doc_id",
    embedding_source_column="content",
    embedding_model_endpoint_name="databricks-bge-large-en"
)

Building a RAG Pipeline

The RAG pipeline consists of 4 stages: Chunk, Embed, Search, and Generate.

from langchain_community.document_loaders import PyPDFLoader
from langchain.text_splitter import RecursiveCharacterTextSplitter

# Step 1: Document Chunking
loader = PyPDFLoader("dbfs:/documents/product_manual.pdf")
documents = loader.load()

text_splitter = RecursiveCharacterTextSplitter(
    chunk_size=1000,
    chunk_overlap=200,
    separators=["\n\n", "\n", ". ", " "]
)
chunks = text_splitter.split_documents(documents)

# Step 2: Embedding (using Databricks Foundation Models)
# Saving chunks to Delta table auto-triggers Vector Search Index embedding
chunks_df = spark.createDataFrame([
    {"doc_id": f"doc_{i}", "content": chunk.page_content, "metadata": str(chunk.metadata)}
    for i, chunk in enumerate(chunks)
])
chunks_df.write.format("delta").mode("append").saveAsTable("production.rag.documents")

# Step 3: Search (similarity search)
results = vsc.get_index("rag-endpoint", "production.rag.document_index").similarity_search(
    query_text="What is the product warranty policy?",
    columns=["content", "metadata"],
    num_results=5
)

# Step 4: Generate (answer generation with LLM)
import mlflow.deployments

client = mlflow.deployments.get_deploy_client("databricks")

context = "\n".join([r["content"] for r in results["result"]["data_array"]])
prompt = f"""Answer the question based on the following context.

Context:
{context}

Question: What is the product warranty policy?
Answer:"""

response = client.predict(
    endpoint="databricks-meta-llama-3-1-70b-instruct",
    inputs={"prompt": prompt, "max_tokens": 500, "temperature": 0.1}
)

Mosaic AI Agent Framework

from databricks.agents import Agent, AgentTool

# Define agent tools
search_tool = AgentTool(
    name="document_search",
    description="Searches internal documents for relevant information",
    func=lambda query: vsc.get_index("rag-endpoint", "production.rag.document_index")
        .similarity_search(query_text=query, num_results=3)
)

sql_tool = AgentTool(
    name="data_query",
    description="Queries business data from the database",
    func=lambda query: spark.sql(query).toPandas().to_dict()
)

# Create agent
agent = Agent(
    model="databricks-meta-llama-3-1-70b-instruct",
    tools=[search_tool, sql_tool],
    system_prompt="You are a customer support agent. Provide accurate answers through document search and data queries."
)

Model Gateway

# Model Gateway - unified interface for multiple LLM providers
# Configure via Databricks UI or REST API

# Call OpenAI model through Databricks Gateway
response = client.predict(
    endpoint="openai-gpt4-gateway",
    inputs={"messages": [{"role": "user", "content": "Write an analysis report"}]}
)

# Call Anthropic Claude through Gateway
response = client.predict(
    endpoint="anthropic-claude-gateway",
    inputs={"messages": [{"role": "user", "content": "Review this code"}]}
)

# Open-source models (Llama, Mistral, etc.) use the same interface
response = client.predict(
    endpoint="databricks-meta-llama-3-1-70b-instruct",
    inputs={"prompt": "Summarize this data", "max_tokens": 300}
)

3-6. Spark Structured Streaming

Trigger Modes

# 1. Available Now - process only currently available data then stop (batch-streaming unification)
query = (
    df.writeStream
    .format("delta")
    .trigger(availableNow=True)
    .option("checkpointLocation", checkpoint_path)
    .toTable("lakehouse.silver.events")
)

# 2. Processing Time - execute micro-batches at specified intervals
query = (
    df.writeStream
    .format("delta")
    .trigger(processingTime="30 seconds")
    .option("checkpointLocation", checkpoint_path)
    .toTable("lakehouse.silver.events")
)

# 3. Continuous (experimental) - real-time processing with millisecond latency
query = (
    df.writeStream
    .format("delta")
    .trigger(continuous="1 second")
    .option("checkpointLocation", checkpoint_path)
    .toTable("lakehouse.silver.events")
)

Watermarking and Late Data Handling

# Event-time windowed aggregation + watermark
from pyspark.sql.functions import window

windowed_counts = (
    events_df
    .withWatermark("event_time", "10 minutes")  # Allow up to 10 min late
    .groupBy(
        window("event_time", "5 minutes", "1 minute"),  # 5-min window, 1-min slide
        "device_type"
    )
    .count()
)

windowed_counts.writeStream \
    .format("delta") \
    .outputMode("append") \
    .trigger(processingTime="1 minute") \
    .option("checkpointLocation", checkpoint_path) \
    .toTable("lakehouse.gold.device_counts_5min")

Delta Live Tables (DLT)

import dlt
from pyspark.sql.functions import col, current_timestamp

# Bronze: raw data ingestion
@dlt.table(
    name="bronze_events",
    comment="Raw event data",
    table_properties={"quality": "bronze"}
)
def bronze_events():
    return (
        spark.readStream
        .format("cloudFiles")
        .option("cloudFiles.format", "json")
        .load("s3://raw-data/events/")
    )

# Silver: data quality validation included
@dlt.table(
    name="silver_events",
    comment="Cleansed event data"
)
@dlt.expect_or_drop("valid_event_id", "event_id IS NOT NULL")
@dlt.expect_or_fail("valid_amount", "amount >= 0")
@dlt.expect("valid_email", "email RLIKE '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+$'")
def silver_events():
    return (
        dlt.read_stream("bronze_events")
        .dropDuplicates(["event_id"])
        .withColumn("processed_at", current_timestamp())
    )

# Gold: business aggregates
@dlt.table(
    name="gold_daily_summary",
    comment="Daily business summary"
)
def gold_daily_summary():
    return (
        dlt.read("silver_events")
        .groupBy("event_date", "category")
        .agg(
            count("*").alias("total_events"),
            spark_sum("amount").alias("total_amount")
        )
    )

Auto Loader

# Auto Loader - automatically detects new files in cloud storage for ingestion
df = (
    spark.readStream
    .format("cloudFiles")
    .option("cloudFiles.format", "json")
    .option("cloudFiles.schemaLocation", "s3://schema/auto_loader/events/")
    .option("cloudFiles.inferColumnTypes", "true")
    .option("cloudFiles.schemaEvolutionMode", "addNewColumns")
    .load("s3://raw-data/events/")
)

# Auto Loader advantages:
# 1. No file listing management needed - new files auto-detected
# 2. Schema inference and evolution - new columns auto-added
# 3. Exactly-once processing guarantee
# 4. Efficient even with millions of files (file notification mode)

3-7. Cloud Infrastructure

AWS Environment

# Databricks architecture on AWS
# 1. Storage: S3 + Delta Lake
storage_config = {
    "data_bucket": "s3://company-lakehouse-prod/",
    "checkpoint_bucket": "s3://company-checkpoints-prod/",
    "metastore_bucket": "s3://company-unity-catalog/",
    "encryption": "SSE-KMS",
    "kms_key": "arn:aws:kms:us-east-1:123456789012:key/xxx"
}

# 2. Compute: EC2 instance-based clusters
cluster_config = {
    "spark_version": "14.3.x-scala2.12",
    "node_type_id": "i3.xlarge",  # Storage optimized
    "driver_node_type_id": "i3.2xlarge",
    "num_workers": 8,
    "autoscale": {"min_workers": 4, "max_workers": 16},
    "aws_attributes": {
        "instance_profile_arn": "arn:aws:iam::123456789012:instance-profile/databricks-role",
        "availability": "SPOT_WITH_FALLBACK",
        "spot_bid_price_percent": 100
    }
}

Azure Environment

# Databricks architecture on Azure
# 1. Storage: ADLS Gen2 + Delta Lake
storage_config = {
    "container": "abfss://lakehouse@companystorage.dfs.core.windows.net/",
    "metastore": "abfss://unity-catalog@companystorage.dfs.core.windows.net/",
    "encryption": "Microsoft Managed Keys",
    "network": "Private Endpoint"
}

# 2. Networking: VNet Injection
# Deploy Databricks workspace directly into customer VNet
# - Private Link for control plane access
# - No Public IP for cluster operation
# - NSG (Network Security Group) for traffic control

GCP Environment

# Databricks architecture on GCP
# 1. Storage: GCS + Delta Lake
storage_config = {
    "bucket": "gs://company-lakehouse-prod/",
    "metastore": "gs://company-unity-catalog/",
    "encryption": "Customer-Managed Encryption Key (CMEK)"
}

# 2. BigQuery integration
# Query BigQuery tables directly from Databricks
bq_df = (
    spark.read
    .format("bigquery")
    .option("table", "project.dataset.table")
    .option("viewsEnabled", "true")
    .load()
)

Terraform for Databricks Workspace Provisioning

# Terraform for Databricks workspace + Unity Catalog setup

provider "databricks" {
  alias = "workspace"
  host  = databricks_workspace.main.workspace_url
}

# Create workspace (AWS example)
resource "databricks_workspace" "main" {
  workspace_name = "production-lakehouse"
  region         = "us-east-1"

  aws_config {
    subnet_ids         = var.private_subnet_ids
    security_group_ids = [var.security_group_id]
    instance_profile   = var.instance_profile_arn
  }

  storage_config {
    s3_bucket_name = var.root_bucket_name
  }
}

# Unity Catalog Metastore
resource "databricks_metastore" "main" {
  provider      = databricks.workspace
  name          = "production-metastore"
  storage_root  = "s3://unity-catalog-metastore/"
  force_destroy = false
}

# Cluster policy
resource "databricks_cluster_policy" "data_engineering" {
  provider = databricks.workspace
  name     = "Data Engineering Policy"

  definition = jsonencode({
    "spark_version" : { "type" : "fixed", "value" : "14.3.x-scala2.12" },
    "autoscale.max_workers" : { "type" : "range", "maxValue" : 20 },
    "node_type_id" : { "type" : "allowlist", "values" : ["i3.xlarge", "i3.2xlarge"] },
    "custom_tags.team" : { "type" : "fixed", "value" : "data-engineering" }
  })
}

3-8. Customer-Facing Skills

FDEs are not just technical experts but also customer engagement specialists. Soft skills are equally important as technical skills.

Technical Discovery: Assessing Customer Data Environments

Discovery Framework:

  1. As-Is Assessment

    • Existing data infrastructure: Hadoop, Snowflake, Redshift, Oracle DW, etc.
    • Data volumes: daily ingestion, total storage, growth rate
    • Current ETL/ELT tools: Informatica, Talend, dbt, Airflow, etc.
    • Data governance maturity: lineage tracking, access control, data quality management
  2. To-Be Definition

    • Scope of migration to Lakehouse architecture
    • Real-time processing requirements
    • AI/ML pipeline goals
    • Cost optimization targets
  3. Gap Analysis

    • Technical capability gap: customer team's Spark/Delta Lake experience
    • Infrastructure gap: cloud maturity, network configuration
    • Process gap: CI/CD, data quality management

Architecture Workshop: Solution Design

Workshop Structure (typically 2-3 days):

  • Day 1: Current architecture review + Lakehouse concepts education
  • Day 2: Medallion Architecture design + hands-on labs
  • Day 3: Migration planning + roadmap agreement

Key Deliverables:

  • Architecture diagrams (As-Is / To-Be)
  • Data Flow Diagrams
  • Migration priority matrix
  • Resource plan (people, infrastructure, timeline)

POC Execution and Success Criteria

Example POC Success Criteria:

MetricTargetMeasurement Method
ETL processing time50% reduction vs currentSame dataset benchmark
Query performanceP95 latency under 5 secondsDashboard query execution
Data quality99.9% accuracySource vs target comparison
Cost30% monthly operational reductionCloud cost comparison

Handoff: PS to Customer Success

Handoff Checklist:

  • Architecture documentation complete
  • Operations runbook written
  • Monitoring/alerting configured
  • Customer team training complete (at least 2 team members self-sufficient)
  • Performance baseline established
  • Escalation paths defined

4. 25 Expected Interview Questions

Spark Technical (8 Questions)

Q1. Explain three main mechanisms by which Spark's Catalyst Optimizer improves query performance.

Model Answer: Predicate Pushdown (pushes filter conditions to the data source level to minimize unnecessary data reads), Column Pruning (reads only required columns to minimize I/O), and Join Reordering (optimizes join order based on statistics to minimize shuffle data). Catalyst uses both Rule-based and Cost-based optimization strategies, and selects the optimal join strategy (BroadcastHashJoin, SortMergeJoin, etc.) during the physical planning phase.

Q2. How do you resolve Data Skew in Spark?

Model Answer: Three main approaches. First, the Salting technique adds random suffixes to hot keys for even partition distribution. Second, enabling AQE's (Adaptive Query Execution) skewJoin feature automatically detects skew at runtime and splits large partitions. Third, Broadcast Join broadcasts small tables to eliminate shuffles altogether.

Q3. Why does using UDFs in PySpark cause performance degradation, and what are the alternatives?

Model Answer: PySpark UDFs require serialization/deserialization (SerDe) of data between JVM and Python processes, creating overhead. Alternatives include maximizing the use of built-in functions (pyspark.sql.functions) or using Pandas UDFs (vectorized UDFs), which transfer data in batches via Apache Arrow for 10-100x performance improvement.

Q4. What is a Spark Shuffle, and what strategies reduce shuffles?

Model Answer: A Shuffle is an expensive operation in Spark that occurs when data needs to be redistributed across partitions (groupBy, join, repartition, etc.). Strategies to reduce shuffles include Broadcast Join to eliminate small table shuffles, proper partitioning (co-partitioning), map-side aggregation (reduceByKey vs groupByKey), and leveraging AQE's partition coalescing feature.

Q5. Explain Spark's memory management model and how to resolve OOM errors.

Model Answer: Spark uses the Unified Memory Manager, where Execution Memory (shuffles, joins, sorts) and Storage Memory (cache, broadcast) dynamically share space. OOM solutions include increasing driver memory (spark.driver.memory), adjusting executor memory (spark.executor.memory), increasing partition count for data distribution, tuning broadcast join threshold (spark.sql.autoBroadcastJoinThreshold), and changing persist level (MEMORY_AND_DISK).

Q6. Explain three core features of AQE (Adaptive Query Execution) in Spark 3.x.

Model Answer: First, Coalesce Shuffle Partitions automatically merges excessively small partitions after shuffle. Second, Skew Join Optimization detects data skew at runtime and splits large partitions for even processing. Third, Dynamic Join Strategy Switching converts from Sort-Merge Join to Broadcast Hash Join based on runtime statistics.

Q7. What is Partition Pruning in Spark, and how does it differ from Dynamic Partition Pruning?

Model Answer: Partition Pruning is an optimization that reads only partitions matching query filter conditions to reduce I/O. Static Partition Pruning applies when filter values are known at compile time. Dynamic Partition Pruning (DPP), introduced in Spark 3.0, prunes partitions at runtime based on the results of one side of a join. It is highly effective when joining large fact tables with small dimension tables.

Q8. What is Spark's Whole-Stage Code Generation?

Model Answer: Whole-Stage Code Generation is a core feature of the Tungsten Engine that compiles multiple operators into a single Java method, eliminating virtual function calls and intermediate data copies. Previously, each operator called next() methods to process one row at a time, but code generation processes rows directly in tight loops, significantly improving CPU cache efficiency and processing speed.

Delta Lake / Unity Catalog (7 Questions)

Q9. How are ACID transactions implemented in Delta Lake?

Model Answer: Delta Lake implements ACID through a transaction log (_delta_log/). All write operations sequentially record commit logs in JSON format and use Optimistic Concurrency Control. On conflict detection, automatic retry occurs, and checkpoint files are created every 10 commits to maintain log reading performance. This guarantees concurrent read/write, atomic rollback on failure, and consistent reads.

Q10. What is the role and design principle of each layer (Bronze/Silver/Gold) in Medallion Architecture?

Model Answer: Bronze is an append-only layer that ingests raw data as-is, preserving the complete history of data sources. Silver is the cleansed data layer performing deduplication, schema standardization, and data quality validation. Gold contains business-perspective aggregate tables directly consumed by dashboards and ML models. The core principle is that each layer should be independently reprocessable, and business value increases from Bronze to Gold.

Q11. What is the difference between Delta Lake's Liquid Clustering and traditional Z-ORDER?

Model Answer: Z-ORDER requires manual execution and full table rewrite when clustering columns change. Liquid Clustering incrementally reorganizes data during OPTIMIZE runs and allows dynamic clustering key changes. Additionally, Liquid Clustering automatically applies optimal clustering based on query patterns, significantly reducing maintenance overhead.

Q12. How do you implement Row Level Security and Column Level Security in Unity Catalog?

Model Answer: Column Level Security defines masking functions that display different column values based on user groups. The IS_ACCOUNT_GROUP_MEMBER function checks group membership to return either the original or masked value. Row Level Security applies row filter functions to tables so only specific rows are visible to specific user groups. Both features are centrally managed in Unity Catalog and consistently applied across all access paths.

Q13. What is Change Data Feed (CDF) and when is it used?

Model Answer: CDF tracks change history (INSERT, UPDATE, DELETE) of Delta tables as separate change data. It is primarily used in CDC (Change Data Capture) pipelines to propagate only changed data downstream. It is effective for incremental updates from Silver to Gold tables, audit logs, and real-time dashboard refreshes. The table_changes() function retrieves only changes since a specific version.

Q14. Why is data lineage important in Unity Catalog and how is it used?

Model Answer: Data lineage tracks the origin and transformation journey of data, essential for regulatory compliance (GDPR data processing records), impact analysis (identifying affected downstream when source tables change), and debugging (tracing root causes of data quality issues). Unity Catalog automatically tracks execution of notebooks, jobs, and queries to provide both table-level and column-level lineage.

Q15. What is UniForm and why is it needed?

Model Answer: UniForm is a feature that automatically exposes Delta Lake tables in Apache Iceberg and Apache Hudi formats. It allows external systems (Snowflake, Trino, Presto, etc.) to read the same data in their native formats. This enables multi-engine environments without data copying and prevents vendor lock-in.

RAG/AI (5 Questions)

Q16. Explain the 4 stages of a RAG pipeline and the optimization points at each stage.

Model Answer: 1) Chunking: splits documents into appropriate sizes. Chunk size (500-1500 tokens) and overlap (10-20%) significantly affect retrieval quality. 2) Embedding: converts text to vectors. Choosing the right embedding model for the domain is crucial. 3) Search: finds relevant documents via vector similarity search. Hybrid search (vector + keyword) improves accuracy. 4) Generate: LLM generates answers using search results as context. Prompt engineering and temperature tuning are key.

Q17. What are the advantages of Delta Sync Index in Databricks Vector Search?

Model Answer: Delta Sync Index automatically synchronizes changes from Delta tables to the vector index. Advantages include: first, no separate sync pipeline needed. Second, CDF-based incremental indexing of only changed data for efficiency. Third, Unity Catalog governance applies consistently to vector indexes for security. Fourth, table version and index version are synchronized to guarantee data consistency.

Q18. What are the key considerations when designing agents with Mosaic AI Agent Framework?

Model Answer: First, Tool design to clearly define the scope and permissions of tools available to the agent. Second, Guardrails to limit the agent's behavioral scope and require human approval for sensitive operations. Third, Evaluation framework to continuously measure agent accuracy, safety, and latency. Fourth, Observability to trace the agent's reasoning process and tool invocations.

Q19. What are the benefits of using Model Gateway?

Model Answer: Model Gateway unifies multiple LLM providers (OpenAI, Anthropic, open-source models) under a single interface. Benefits include: first, centralized API key management for enhanced security. Second, switching between models is possible through configuration alone without code changes. Third, unified cost tracking and usage monitoring. Fourth, centralized rate limiting and fallback strategies. Fifth, Unity Catalog governance extends to LLM calls.

Q20. What strategies reduce hallucination in RAG systems?

Model Answer: First, improve retrieval quality through hybrid search (vector + BM25), Reranking models, and metadata filtering to provide highly relevant context. Second, prompt engineering by adding instructions like "answer only based on the provided context." Third, forcing citations so the LLM specifies evidence for its answers. Fourth, answer verification pipelines that automatically validate whether generated answers are consistent with source documents.

Customer Scenarios (5 Questions)

Q21. A customer wants to migrate from Hadoop to Databricks. What approach would you propose?

Model Answer: I would propose a phased migration. Phase 1: Data lake migration to move HDFS data to S3/ADLS and convert to Delta Lake. Phase 2: ETL pipeline migration to convert Hive/Pig jobs to Spark/Delta Live Tables. Phase 3: Analytics workload migration to convert Hive queries to Spark SQL. Both systems run in parallel throughout migration to minimize risk, with data integrity validation at each phase.

Q22. How would you respond when a POC fails to achieve the performance the customer expects?

Model Answer: First, precisely analyze the performance bottleneck. Check per-stage execution time, shuffle data volume, and skew occurrence in Spark UI. Then attempt optimization: changing partitioning strategy, caching, broadcast joins, enabling AQE, etc. If data characteristics make the target unreachable, transparently share with the customer, presenting achievable realistic figures and a further optimization roadmap.

Q23. The customer's data engineers are unfamiliar with Spark. How would you transfer knowledge?

Model Answer: I use a 3-stage training strategy. Stage 1 Hands-on Workshop (1 week): build a basic ETL pipeline together using actual customer data. Stage 2 Pair Programming (2-4 weeks): run real projects with pair programming, gradually transferring ownership. Stage 3 Self-service (ongoing): provide documented best practices, template notebooks, and troubleshooting guides, with weekly office hours for support.

Q24. A customer requests cost optimization. What analysis and improvements would you propose?

Model Answer: First, build a cost analysis dashboard visualizing costs by cluster, workload, and team. Key optimization points: Spot instances for 40-90% cost reduction. Auto-termination policies to eliminate unused cluster costs. Cluster pooling for faster start times and resource sharing. Delta Lake OPTIMIZE and VACUUM for storage cost reduction. Job clusters for cost optimization over interactive clusters. Typically 30-50% cost reduction is achievable.

Q25. A financial institution customer prioritizes data governance and regulatory compliance (GDPR, SOX). How would you design the solution?

Model Answer: Build a governance framework centered on Unity Catalog. GDPR: apply masking functions to PII columns, maintain processing records through data lineage tracking, set up DELETE + VACUUM processes for Right to Erasure requests. SOX: Row Level Security for financial data access control, audit logs for all data access records, preserve change history via Delta Lake Time Travel. Additionally apply data classification tagging, retention policies, and encryption (at rest and in transit).


5. 8-Month Study Roadmap

MonthTopicGoal
1-2Apache Spark Basics to IntermediateMaster PySpark DataFrame API, Spark SQL, basic optimization
2-3Delta Lake and LakehouseImplement Medallion Architecture, practice ACID/Time Travel
3-4Unity Catalog and Governance3-level namespace, access control, lineage tracking
4-5MLflow and Feature EngineeringExperiment tracking, model registry, Feature Store
5-6Mosaic AI (RAG/Agents)Vector Search, RAG pipeline, Agent Framework
6-7Cloud Infrastructure and TerraformDatabricks provisioning on AWS/Azure, IaC
7-8Customer Scenarios and Mock InterviewsPOC simulation, architecture design, presentation practice
8Certifications and Final PrepObtain Databricks Certified Data Engineer Associate

Monthly Detailed Guide:

Months 1-2: Spark Mastery

  • Sign up for Databricks Community Edition (free)
  • Practice PySpark DataFrame API with real datasets
  • Build Spark UI reading skills: Stage, Task, Shuffle analysis
  • Optimization practice: broadcast join, partition pruning, AQE

Months 3-4: Delta Lake + Unity Catalog

  • Practice CRUD and Time Travel with the Delta Lake Quickstart
  • Implement Medallion Architecture with an e-commerce dataset
  • Create catalogs/schemas/tables and manage permissions in Unity Catalog
  • Practice Row/Column Level Security

Months 5-6: AI/ML Pipelines

  • Track model experiments and use the registry with MLflow
  • Build a RAG pipeline with PDF documents
  • Create a Vector Search Index and implement similarity search
  • Deploy a Model Serving Endpoint

Months 7-8: Integration Project and Interview Prep

  • Build an end-to-end project (see portfolio below)
  • Practice customer scenario role-plays
  • Obtain Databricks certification
  • Conduct at least 5 mock interviews

6. Certification Guide

Databricks Certified Data Engineer Associate

  • Difficulty: Intermediate
  • Scope: Spark, Delta Lake, ETL, Lakehouse fundamentals
  • Format: 45 questions, 90 minutes, 70% passing score
  • Recommended Prep Time: 4-6 weeks
  • Focus: Data engineering fundamentals in the Databricks environment

Databricks Certified Machine Learning Associate

  • Difficulty: Intermediate
  • Scope: MLflow, Feature Store, AutoML, Model Serving
  • Format: 45 questions, 90 minutes, 70% passing score
  • Recommended Prep Time: 4-6 weeks
  • Focus: ML lifecycle management in the Databricks environment

Databricks Certified Data Engineer Professional

  • Difficulty: Hard
  • Scope: Advanced ETL, performance optimization, production pipelines, Delta Live Tables
  • Format: 60 questions, 120 minutes, 70% passing score
  • Recommended Prep Time: 8-12 weeks
  • Focus: Data engineering expertise in large-scale production environments

Databricks Generative AI Engineer Associate (New in 2025)

  • Difficulty: Intermediate-Hard
  • Scope: RAG, Vector Search, Mosaic AI, Agent Framework, Model Gateway
  • Format: 45 questions, 90 minutes, 70% passing score
  • Recommended Prep Time: 6-8 weeks
  • Focus: Building Gen AI applications in the Databricks environment

Recommended Order: Obtain Data Engineer Associate first, then add ML Associate or Gen AI Associate for a strong FDE position profile.


7. Three Portfolio Projects

Project 1: E-commerce Lakehouse (Medallion Architecture)

Goal: Build a Bronze/Silver/Gold pipeline with real e-commerce data

Tech Stack: PySpark, Delta Lake, DLT, Unity Catalog, Auto Loader

Implementation:

  • Bronze: Real-time JSON event data ingestion with Auto Loader
  • Silver: Data quality validation (DLT Expectations), deduplication, schema standardization
  • Gold: Customer RFM (Recency, Frequency, Monetary) analysis, daily revenue aggregation
  • Unity Catalog data governance: PII masking, team-based access control

Project 2: Customer Support RAG Chatbot

Goal: Build a customer support chatbot based on internal documents

Tech Stack: Vector Search, Mosaic AI, LangChain, MLflow, Model Serving

Implementation:

  • Chunk and embed product manuals, FAQs, and technical documents
  • Auto-reflect document updates via Delta Sync Index
  • Build agent with Mosaic AI Agent Framework
  • Evaluate RAG quality with MLflow (faithfulness, relevance, groundedness)
  • Production deployment via Model Serving Endpoint

Project 3: Real-time Anomaly Detection Pipeline

Goal: Real-time anomaly detection from IoT sensor data

Tech Stack: Spark Structured Streaming, Delta Lake, MLflow, Model Serving

Implementation:

  • Ingest sensor data from Kafka with Structured Streaming
  • Detect anomalies using window-based statistics (moving average, standard deviation)
  • Real-time inference with MLflow-trained Isolation Forest model
  • Slack/PagerDuty alerting on anomaly detection
  • Real-time monitoring dashboard

8. Quiz

Let us test what you have learned.

Q1. What is Databricks Lakehouse Architecture, and what limitations of traditional Data Lakes and Data Warehouses does it solve?

A: Lakehouse Architecture is a unified platform combining the flexibility of Data Lakes (unstructured data storage, low-cost storage) with the reliability of Data Warehouses (ACID transactions, schema management, performance). It solves Data Lake limitations such as lack of data quality management, missing transaction support, and poor metadata management, while also addressing Data Warehouse limitations such as inability to handle unstructured data, high costs, and lack of ML workload support. Delta Lake serves as the storage layer and Unity Catalog as the governance layer, forming the core of the Lakehouse.

Q2. What problems are automatically optimized when AQE (Adaptive Query Execution) is enabled in Spark?

A: AQE addresses three core problems. First, excessive shuffle partitions: it automatically coalesces small partitions after shuffle to reduce task count. Second, data skew: it detects skew at runtime and automatically splits large partitions for even processing. Third, join strategy inefficiency: it automatically switches from Sort-Merge Join to Broadcast Hash Join based on runtime statistics. All these optimizations are applied through configuration alone without code changes.

Q3. Why is Unity Catalog's 3-level namespace (catalog.schema.table) structure important for data governance?

A: The 3-level namespace enables systematic classification of organizational data assets and fine-grained access control. The Catalog level separates environments (production/development) or domains (finance/marketing), the Schema level distinguishes data subject areas, and the Table level manages individual datasets. Independent permission settings at each level enable the principle of least privilege, with support for cross-catalog joins and automatic data lineage tracking.

Q4. How do chunk size and overlap affect retrieval quality in a RAG pipeline?

A: If chunk size is too small, context information is insufficient and search results may have incomplete meaning; if too large, too much noise is included and relevance drops. Generally, 500-1500 tokens is appropriate. Overlap prevents information from being cut off at chunk boundaries. 10-20% overlap is typical; without overlap, sentences may be cut mid-way and lose meaning. Optimal values depend on document characteristics and should be determined through experimentation.

Q5. When an FDE's POC project fails to meet performance targets, what steps should be taken to analyze and respond?

A: A systematic analysis is needed. Step 1 Diagnosis: analyze per-stage execution time, shuffle data volume, skew presence, and GC time in Spark UI. Step 2 Optimization: try changing partitioning strategy, applying broadcast joins, enabling AQE, caching strategies, and cluster size adjustments. Step 3 Communication: transparently share optimization results and realistically achievable figures with the customer. Present additional optimization roadmap and, if needed, propose architecture-level changes (e.g., switching from batch to streaming). The key is not hiding problems but communicating with data-driven evidence.


9. References

Official Documentation

  1. Databricks Official Docs - docs.databricks.com - Complete Databricks platform reference
  2. Apache Spark Official Docs - spark.apache.org/docs - Spark API and guides
  3. Delta Lake Official Docs - docs.delta.io - Delta Lake open-source documentation
  4. MLflow Official Docs - mlflow.org/docs - MLflow API and guides

Certification Preparation

  1. Databricks Academy - academy.databricks.com - Free and paid training courses
  2. Data Engineer Associate Exam Guide - databricks.com/learn/certification
  3. Gen AI Engineer Associate Exam Guide - databricks.com/learn/certification
  4. Databricks Community Edition - community.cloud.databricks.com - Free practice environment

Learning Resources

  1. Learning Spark, 2nd Edition - by Jules Damji et al., the Spark bible
  2. Delta Lake: The Definitive Guide - O'Reilly, official Delta Lake guidebook
  3. Databricks Blog - databricks.com/blog - Latest tech updates and case studies
  4. Data + AI Summit Videos - databricks.com/dataaisummit - Annual conference sessions
  1. Databricks IPO News - Trackable via Bloomberg, Reuters, etc.
  2. Lakehouse Architecture Paper - "Lakehouse: A New Generation of Open Platforms"
  3. Gartner Magic Quadrant for Cloud DBMS - Market positioning analysis

Community

  1. Databricks Community Forum - community.databricks.com
  2. r/databricks - reddit.com/r/databricks - Community Q&A
  3. Databricks Slack - Direct communication with engineers on the official Slack channel

Closing

The Databricks AI Engineer (FDE) position is one of the most exciting roles in the AI era. It is not just about writing code, but about directly delivering world-class Lakehouse technology to enterprise customers.

To summarize what this guide covered:

  • Databricks is a 62 billion dollar Lakehouse-inventing company, and FDE is the core customer-facing team
  • Spark, Delta Lake, Unity Catalog, and Mosaic AI form the core tech stack
  • Medallion Architecture and RAG pipeline building capabilities are key differentiators
  • Preparation is possible with 8 months of systematic study and 3 portfolio projects
  • Customer-facing skills are as important as technical skills

If you follow this roadmap systematically, it will provide a solid foundation for starting your career as a Databricks FDE. The intersection of Lakehouse and AI is growing rapidly, and demand for engineers with these capabilities will continue to increase.

Good luck!