Data Lakehouse Architecture
1. Executive Summary
A data lakehouse unifies the low-cost, schema-flexible storage of a data lake (object storage such as S3, GCS, or ADLS) with the transactional semantics, schema enforcement, and performance optimizations traditionally associated with a data warehouse. The architectural breakthrough is not a single product—it is the open table format layer (Apache Iceberg, Delta Lake, Apache Hudi) that sits above Parquet/ORC files and provides ACID transactions, time travel, schema evolution, and concurrent writers on commodity object storage.
The medallion architecture (bronze/silver/gold) is the dominant organizational pattern: raw ingestion (bronze), cleaned and conformed data (silver), and business-ready aggregates (gold). Lakehouses power modern analytics platforms at Netflix, Uber, Apple, and thousands of enterprises replacing siloed lake + warehouse stacks with a single governed platform.
For principal architects, the lakehouse decision is a consistency, cost, and governance tradeoff: you gain elasticity and open formats but inherit compaction, metadata scaling, small-file problems, and multi-engine coordination complexity that warehouses hide behind managed infrastructure.
2. Why This Topic Matters
Lakehouse architecture appears in principal interviews when organizations consolidate Spark/Flink pipelines, BI tools, and ML feature stores onto shared storage. Panels probe:
- Open table formats—how ACID works without a traditional database server.
- Medallion vs data mesh—organizational and technical boundaries.
- Lake vs warehouse vs lakehouse—when each wins.
- Concurrency—what happens when two Spark jobs commit simultaneously.
- Governance—row/column policies across engines (Trino, Spark, Snowflake external tables).
Misunderstanding lakehouses leads to "S3 with Parquet" designs that lack idempotent pipelines, explode metadata, or corrupt tables under concurrent writes.
3. Problems Being Solved
| Problem | Lakehouse approach |
|---|---|
| Expensive proprietary warehouse storage | Decouple compute; store in object storage |
| Unreliable data lakes | ACID + schema enforcement via table format |
| Duplicate ETL to lake and warehouse | Single source of truth with multiple query engines |
| ML + analytics silos | Shared tables for features and BI |
| Time travel / audit | Snapshot isolation per table format |
| Schema drift | Evolution rules in metadata layer |
Workload fit matrix
| Workload | Fit | Caveat |
|---|---|---|
| Batch analytics (TB–PB) | Strong | Compaction and partition design matter |
| Streaming ingestion | Strong | Requires streaming writers + idempotency |
| Low-latency OLTP | Weak | Not a replacement for operational databases |
| Ad hoc SQL (sub-second) | Moderate | Needs indexing, caching, or warehouse overlay |
| ML feature engineering | Strong | Point-in-time correctness requires discipline |
| Regulatory audit / replay | Strong | Time travel and lineage integration |
4. Assumptions and System Model
| Assumption | Implication |
|---|---|
| Object storage is durable and eventually consistent listing | List-after-write visibility; retry semantics vary by cloud |
| Compute is ephemeral | Spark/Flink clusters scale independently of storage |
| Table format provides atomic commit | Single metadata pointer swap per commit |
| Readers use consistent snapshot | Snapshot isolation; no dirty reads of in-flight writes |
| Network egress costs are non-trivial | Co-locate compute with data region |
Safety: Committed snapshots are durable; readers never see partial multi-file writes after commit. Liveness: Writers may retry on commit conflicts; heavy compaction backlog can delay optimal read performance without blocking correctness.
5. Essential Terminology
| Term | Definition |
|---|---|
| Open table format | Specification for table metadata, snapshots, and file layout (Iceberg, Delta, Hudi) |
| Medallion architecture | Bronze (raw) → silver (cleaned) → gold (curated) layering |
| Snapshot | Point-in-time consistent view of table files |
| Compaction | Merging small files into larger objects for scan efficiency |
| Partition | Logical subdivision (often by date/region) affecting pruning |
| Manifest / metadata file | Catalog of data files belonging to a snapshot |
| COPY-ON-WRITE (COW) | Updates rewrite data files (Iceberg default for many ops) |
| MERGE-ON-READ (MOR) | Updates logged separately; compacted later (Hudi MOR) |
| Z-ordering | Multi-dimensional clustering for scan pruning (Delta) |
| Data skipping | Min/max statistics in metadata to avoid reading irrelevant files |
6. Core Mechanism
6.1 Layered architecture
Figure 1: Engines share a table format layer; object storage holds immutable data files; metadata atomically advances snapshots.
6.2 Atomic commit (simplified)
Figure 2: Compare-and-swap on metadata version ensures exactly one writer advances the table snapshot.
6.3 Medallion pipeline
Figure 3: Progressive refinement with increasing quality and decreasing schema variance toward consumption.
6.4 Format comparison (implementation choices)
| Dimension | Apache Iceberg | Delta Lake | Apache Hudi |
|---|---|---|---|
| Originating ecosystem | Netflix → Apache | Databricks | Uber → Apache |
| Catalog integration | REST, Hive, Glue, Nessie | Unity Catalog, Hive | Hive, Glue |
| Row-level updates | Merge (v2) | Merge | Upsert, MOR/COW |
| Hidden partitioning | Yes | Partition columns explicit | Yes (timeline) |
| Engine breadth | Spark, Flink, Trino, etc. | Spark-first; growing | Spark, Flink |
Verify current version features in official docs—formats evolve rapidly.
7. Step-by-Step Walkthrough
Walkthrough A: Batch ingest to bronze
- Landing zone receives JSON/CSV from Kafka or API dumps.
- Spark job reads landing files, adds
_ingest_tsand_sourcemetadata columns. - Writer appends to
bronze.eventsIceberg table partitioned byingest_date. - Commit succeeds; snapshot N+1 visible to readers.
- Orchestrator (Airflow/Dagster) marks partition complete; moves landing files to archive.
Walkthrough B: Silver transformation with deduplication
- Silver job reads bronze snapshot at version V (idempotent re-run uses same V or later).
- Applies schema validation, PII tokenization, dedup on
event_id. - MERGE INTO silver table on primary key.
- On commit conflict, job retries with exponential backoff.
- Data quality checks assert row count bounds before promoting to gold consumers.
Walkthrough C: Time-travel audit
- Compliance requests state of
customerstable as of2025-06-01T00:00:00Z. - Analyst runs
SELECT ... FOR VERSION AS OFor timestamp equivalent. - Engine resolves snapshot ID from metadata; scans only files in that snapshot.
- Result exported to audit bucket with lineage ticket reference.
Walkthrough D: Compaction after streaming micro-batches
- Flink writes 5-minute micro-batches creating hundreds of small Parquet files.
- Compaction job (OPTIMIZE in Delta, rewrite_data_files in Iceberg) merges files per partition.
- Old files marked deleted in new snapshot; orphan cleanup policy runs separately.
- BI queries see improved scan parallelism and reduced LIST operations.
Walkthrough E: Iceberg vs Delta coexistence decision
- Architecture review evaluates engine mix: Databricks-heavy teams lean Delta; multi-engine (Flink + Trino + Spark) lean Iceberg.
- Proof-of-concept runs concurrent readers on same table format with representative queries.
- Catalog choice finalized: Glue + Iceberg REST or Unity Catalog for Delta.
- ADR documents format lock-in risk and migration escape hatch (export Parquet, re-register).
- Platform team publishes golden path templates for bronze/silver/gold dbt models.
Walkthrough F: Schema evolution without breaking consumers
- Silver table adds nullable column
customer_tierwith defaultunknown. - Iceberg schema evolution commits; old snapshots retain old schema for time travel.
- Gold dbt models updated in same release train; contract tests assert column presence.
- BI semantic layer versioned; dashboards using old views continue until deprecation window ends.
- Governance catalog marks schema version bump; lineage shows downstream impact count.
8. Invariants and Guarantees
| Property | Lakehouse guarantee |
|---|---|
| Atomicity | Snapshot commit is all-or-nothing |
| Consistency | Schema and partition specs enforced at write |
| Isolation | Snapshot isolation for readers |
| Durability | Committed files durable per object storage SLA |
| Serializability of writes | One winning writer per commit attempt; losers retry |
Not guaranteed: Sub-second interactive latency without additional indexing layers; cross-table transactional consistency (unless application-level or specialized catalogs).
9. Failure Scenarios
| Failure | Behavior | Mitigation |
|---|---|---|
| Concurrent write conflict | Commit fails; job retries | Idempotent MERGE keys; partition serial writers |
| Small file explosion | Metadata bloat; slow queries | Scheduled compaction; target file size tuning |
| Orphan files after failed commit | Storage cost leak | Lifecycle rules + orphan file cleanup jobs |
| Schema incompatibility | Write rejected | Schema evolution policies; contract tests |
| Catalog outage | Cannot resolve table metadata | HA catalog; cached metastore |
| Partition skew | Hot partitions; straggler tasks | Salting; redesign partition keys |
| Zombie snapshot retention | Storage growth | Retention policies; expire_snapshots |
Scenario narrative
A nightly and hourly job both MERGE into silver.orders. The hourly job commits first; nightly job's CAS fails at 03:00. Without retry logic, silver is stale until manual intervention. Production pipelines must treat commit conflicts as expected, not exceptional.
10. Performance Characteristics
| Dimension | Behavior |
|---|---|
| Scan throughput | Scales with file parallelism; depends on file sizes |
| Write latency | Metadata commit + file upload; not OLTP-grade |
| Metadata operations | O(files in snapshot) for planning; manifests amortize |
| Compaction cost | Rewrite I/O; schedule off-peak |
| Partition pruning | Critical for petabyte tables |
Object storage LIST latency can dominate planning for tables with millions of files—compaction and partition design are performance architecture, not optional tuning.
11. Scalability Limits
- Metadata file count per table—billions of files require aggressive compaction and partitioning strategy.
- Single partition hotspots limit write parallelism.
- Cross-region reads incur egress and latency.
- Concurrent writers to same partition serialize at commit layer.
- Catalog as control plane can become bottleneck at extreme scale.
12. Operational Considerations
- Define SLAs per medallion layer (bronze freshness vs gold correctness).
- Automate compaction, snapshot expiration, and orphan cleanup.
- Monitor files per partition, commit conflict rate, job duration variance.
- Version-pin table format and engine combinations in production.
- Run disaster recovery drills: restore catalog + validate snapshot integrity.
- Document partition evolution procedure before changing keys on PB tables.
- Integrate data quality gates between silver and gold promotion.
13. Security Considerations
- IAM policies on bucket prefixes per environment (dev/staging/prod).
- Column-level encryption or tokenization before bronze when PII present.
- Lake Formation / Unity Catalog / Ranger for fine-grained access across engines.
- Audit logs on catalog access and sensitive table reads.
- Network isolation: private endpoints to object storage; no public buckets.
14. Cost Considerations
- Storage: cheap at rest; expensive when duplicated across snapshots without expiration.
- Compute: Spark/Flink cluster hours for ETL and compaction.
- API costs: LIST/GET requests during query planning.
- Egress: cross-AZ and cross-region data movement.
- Hidden cost: engineer time for file layout and incident response.
FinOps principle: gold tables should be smaller and better partitioned than bronze—if gold scans are petabyte-wide, the medallion failed its curation purpose.
15. Production Implementations
Case study: Unified analytics platform (illustrative)
Business context
Retail enterprise runs separate Hadoop lake and cloud warehouse; duplicate pipelines, inconsistent metrics, $4M+ annual warehouse storage. Mandate: single metrics layer for BI and ML.
Scale
Illustrative: 20 PB object storage; 5,000 tables; 200 daily pipelines; 400 analysts.
Architecture overview
S3 + Apache Iceberg + Glue catalog + EMR Spark for ETL + Trino for ad hoc SQL + dbt for gold transformations. Bronze ingests from Kafka and SFTP. Silver enforces contracts. Gold exports to semantic layer (Looker/MetricFlow).
Partitioning
event_date + region for fact tables; dimension tables unpartitioned with periodic full refresh.
Consistency
Snapshot isolation; MERGE idempotency keys on order_id. No cross-table transactions—workflow orchestration ensures gold runs after silver SLA.
Failure handling
Airflow sensors on upstream freshness; commit conflict retries (3x); DLQ for poison bronze records.
Evolution
Phase 1: lift-and-shift warehouse exports to bronze. Phase 2: retire duplicate warehouse marts. Phase 3: ML features read gold directly.
Extended operations narrative
Six months post-launch, commit conflict rate spiked on silver.orders when hourly and nightly MERGE jobs overlapped. Platform team introduced partition-level job locks in Airflow and reduced conflicts 94%. Compaction backlog grew during Black Friday—dedicated OPTIMIZE warehouse slot added Tuesdays and Fridays. FinOps attributed $180k annual savings vs prior warehouse-only stack [illustrative—verify in your org]. Key lesson: lakehouse TCO includes platform engineering headcount, not just S3 storage lines.
Tradeoffs
| Choice | Tradeoff |
|---|---|
| Iceberg over Delta | Engine neutrality vs Databricks integration depth |
| Trino for ad hoc | Flexibility vs managed warehouse performance |
| Daily gold only | Cost vs near-real-time dashboards |
Interview lessons
Articulate why lakehouse vs warehouse; quantify compaction and metadata ops; governance across engines.
Platform team operating model
Lakehouse platforms require dedicated data platform engineering—not a one-time migration project. Standing responsibilities include: table format upgrades, compaction SLOs, catalog hygiene, cost attribution per domain, and on-call for failed commits during peak ETL. Principal architects staffing this function should plan 1 platform engineer per 50–100 active pipelines as a rough order-of-magnitude [org-dependent, not a universal benchmark].
Anti-patterns observed in production
| Anti-pattern | Symptom | Remediation |
|---|---|---|
| Bronze overload | 90% storage in raw JSON | Aggressive silver promotion |
| No snapshot expiry | Storage bill 3× expected | expire_snapshots policy |
| Shared write partition | Commit conflict storms | Partition ownership |
| BI on bronze | Schema chaos | Enforce gold-only BI access |
| Manual compaction | Weekly fire drills | Scheduled OPTIMIZE jobs |
16. Alternatives and Tradeoffs
| Approach | When to choose |
|---|---|
| Traditional warehouse (Snowflake, BigQuery) | Managed performance, less file ops burden |
| Raw data lake only | Exploratory science; weak governance tolerance |
| Lakehouse | Open formats, multi-engine, cost at scale |
| Data mesh | Organizational decentralization; can use lakehouse per domain |
| HTAP database | Operational analytics on transactional data |
17. Common Misconceptions
| Misconception | Reality |
|---|---|
| "Parquet on S3 is a lakehouse" | Missing ACID metadata and governance |
| "Lakehouse replaces warehouse always" | Many teams run hybrid with warehouse serving layer |
| "One big table is fine" | Partitioning and file layout determine viability |
| "ACID means cross-table transactions" | Typically single-table snapshot atomicity |
| "Compaction is optional" | Required for sustained performance |
18. Principal Architect Perspective
- Pick table format based on engine ecosystem and catalog strategy—not hype.
- Invest in medallion contracts early; bronze permissive, gold strict.
- Treat compaction as production workload with SLOs, not ad hoc scripts.
- Plan governance before 500 tables, not after.
- Measure cost per curated GB in gold—not just storage totals.
19. Architecture Review Exercise
Scenario: Team proposes 1-minute micro-batches to gold fact table with 50 columns, no compaction, shared partition ingest_date only.
Findings: Small-file death spiral; hot partition; BI scans degrade within weeks. Recommend: silver buffering, hourly compaction, composite partition (date, hour), aggregate before gold.
20. Whiteboard Explanation
"Data lands in object storage as Parquet files, but files alone aren't a database. An open table format maintains a metadata layer—manifests listing files, schemas, partitions, and snapshots. When a Spark job writes, it uploads new files then atomically swaps the metadata pointer from snapshot N to N+1 using compare-and-swap, so readers always see a consistent snapshot. Bronze keeps raw data; silver cleans and deduplicates; gold serves BI and ML. Multiple engines—Spark, Flink, Trino—read the same tables if they support the format. The hard parts are compaction, concurrent write retries, and governance across engines—not the diagram."
Principal addendum: When asked "lakehouse vs warehouse," draw cost axes: storage $/TB, compute elasticity, and ops headcount. Warehouse wins on time-to-first-query for undifferentiated SQL; lakehouse wins on petabyte economics and ML co-location. Hybrid is common—do not force binary choice in enterprise landscapes.
21. Interview Questions
- What is a lakehouse? — Lake storage + warehouse-like ACID and schema via table formats.
- How does ACID work on S3? — Atomic metadata commit; immutable data files.
- Bronze vs silver vs gold? — Progressive refinement and trust levels.
- Iceberg vs Delta vs Hudi? — Ecosystem, merge semantics, catalog—tradeoffs.
- What is snapshot isolation? — Readers pin a snapshot version.
- Why compaction? — Reduce small files and metadata overhead.
- Concurrent write failure mode? — Commit conflict; retry required.
- Lake vs warehouse cost model? — Decoupled storage/compute vs integrated unit.
- Time travel use cases? — Audit, rollback, reproducible ML training.
- When not lakehouse? — Low-latency OLTP, tiny datasets, team lacks Spark ops.
- Partition skew symptoms? — Single task dominates; uneven file counts.
- Data mesh relationship? — Complementary; mesh is organizational, lakehouse is technical.
- Exactly-once ingestion? — Idempotent writes + deterministic keys + format commits.
- Governance challenge? — Same policy across heterogeneous query engines.
Scoring rubric (principal)
| Dimension | Strong | Weak |
|---|---|---|
| ACID mechanism | Metadata CAS, immutable files | "S3 is transactional" |
| Operations | Compaction, conflicts, orphans | Ignores file layout |
| Tradeoffs | Hybrid warehouse scenarios | "Lakehouse replaces all" |
| Governance | Catalog, lineage, PII | Bucket IAM only |
22. Interview Follow-Ups
- Design medallion for clickstream at 1M events/sec. — Kafka → Flink bronze; micro-batch silver; agg gold; compaction schedule.
- Two teams write same Iceberg table—safe? — Possible with retry; better partition ownership or serial writes per partition.
- Recover from bad gold deploy. — Time travel to prior snapshot; rollback workflow.
- Cost of keeping 90 days snapshots? — Storage multiplication; expire_snapshots policy.
- BI needs sub-5s queries on 500 TB. — Materialized aggregates, indexing (Iceberg deletes vectors), or warehouse sync.
22A. Production Low-Level Design (Interview + Game Day)
Medallion lakehouse on object storage with Iceberg/Delta commits. Production LLD and Game Day Standard.
Control vs data plane
| Plane | Components |
|---|---|
| Control | Catalog (Glue/Hive), snapshot metadata CAS, compaction jobs, governance tags |
| Data | Bronze Parquet files, silver/gold tables, query engines (Spark/Trino/Flink) |
Step-by-step commit path:
| Step | Action | ACID mechanism |
|---|---|---|
| 1 | Writer stages new data files in object storage | Files immutable |
| 2 | Writer commits new metadata JSON | Catalog CAS on snapshot pointer |
| 3 | Readers pin old snapshot | Snapshot isolation |
| 4 | Concurrent writer conflict | Retry with exponential backoff |
| 5 | Compaction merges small files | New snapshot; old files orphan until GC |
Table contract
| Layer | Format | Freshness SLO |
|---|---|---|
| Bronze | Append-only Parquet | Near real-time |
| Silver | MERGE upserts | 15 min micro-batch |
| Gold | Aggregated | 1h or on-demand refresh |
One SLO
Lakehouse query freshness: gold tables lag source events < 1h p99; compaction completes before read amplification alert.
22B. Game Day Playbooks
| # | Drill | Inject | Detect | Mitigate | Verify |
|---|---|---|---|---|---|
| GD-1 | Bad gold deploy | Wrong aggregation logic shipped | BI dashboard anomaly | Time travel to prior snapshot | Metrics match baseline |
| GD-2 | Catalog CAS failure | Simulate catalog outage | Writers fail commit | Failover catalog; pause writers | No torn reads |
| GD-3 | Small-file explosion | Stop compaction 7d | Query p99 regression | Emergency compaction job | File count normalized |
GD-1 — Rollback via time travel
23. Strong Answer Example
Question: "How does a lakehouse provide ACID on object storage?"
Answer this as a 45-minute greenfield design using the PRACTICE framework. Below is how a strong student sounds aloud—separate object storage durability from table-format atomicity, then walk the commit protocol.

Figure A: PRACTICE map — Problem → Requirements → Assumptions → Capacity → Topology → Invariants → Constraints → Evolution.
Student interview script (PRACTICE)
P — Problem framing
"Object storage like S3 gives durable, immutable object PUTs—but not multi-file transactions. A naive lake of Parquet files has no atomic commit: readers can see half a write, and concurrent Spark jobs can corrupt the table.
A lakehouse fixes that with an open table format (Iceberg, Delta Lake, Hudi) that adds a metadata + catalog commit protocol on top of those files—so we get table-level ACID without a traditional database server.
Non-goals for v1: OLTP low-latency row updates, and true cross-table multi-statement transactions. I'll be honest that ACID here is usually per table / per snapshot."
R — Requirements
| Type | Requirement |
|---|---|
| FR | Append / overwrite / MERGE; concurrent readers; time travel; schema evolution |
| NFR | Atomic visibility of a commit; no torn reads; durable after successful commit |
| Isolation | Snapshot isolation—readers pin a snapshot while writers advance the head |
| Ops | Compaction, snapshot expiration, catalog HA; conflict retries on concurrent writes |
"I'll ask: Iceberg, Delta, or Hudi? Single engine (Databricks) or multi-engine (Spark + Trino + Flink)? I'll assume S3 + Iceberg or Delta, multi-engine OK."
A — Assumptions (state aloud)
| Assumption | Why it matters |
|---|---|
| Data files are immutable once written | Simplifies isolation—never mutate in place |
| Catalog supports atomic CAS of the current snapshot pointer | This is the A in ACID |
| Writers retry on commit conflict | Optimistic concurrency, not row locks |
| Single-table transactions | Cross-table consistency is orchestration, not the format |
| Compaction is operationally mandatory | Small files kill query performance |
"If they say 'S3 is transactional,' I'd correct: S3 is durable; the table format is transactional."
C — Capacity (back-of-envelope + metadata)
Table size (say) → 50 TB Parquet on S3
Files per commit (naive) → hundreds of small files → metadata + planning blow up
Snapshots retained → N days for time travel; expire old metadata
Concurrent writers → 2–10 jobs; commit conflicts → retry rate matters
Catalog ops → every commit = metadata write + CAS; Hot partitions OK
Compaction SLO → rewrite small files → fewer manifests, faster scans
Reader pin duration → long Spark job holds snapshot; don't expire too aggressively
"Capacity failures in lakehouses are often metadata / small-file problems, not raw S3 GB."
T — Topology (draw this)

Figure B: Engines → catalog (atomic snapshot pointer) → table-format metadata → immutable data files on object storage.
How each ACID letter maps (say this aloud):
| Letter | Mechanism on object storage |
|---|---|
| Atomicity | Upload data files first; then one CAS flips the snapshot pointer—all-or-nothing visibility |
| Consistency | Schema + partition constraints enforced in metadata before commit accepted |
| Isolation | Snapshot isolation—readers see a committed snapshot; never in-flight file sets |
| Durability | Data objects + metadata objects durable on S3/ADLS; commit succeeds only after both |

Figure C: Read snapshot → write immutable files → build new snapshot → CAS pointer; conflict → retry.
Commit protocol (whiteboard steps):
- Writer reads current snapshot from catalog.
- Writer uploads new immutable Parquet/ORC files (and delete files / position deletes as needed).
- Writer builds new snapshot metadata listing the full file set (or delta from parent).
- Writer CAS-updates the catalog pointer
old → new. - Success → all readers resolving "current" see the complete new snapshot.
- Conflict (another writer won) → abort, refresh metadata, retry (optimistic CC).
I — Invariants (safety)
"Non-negotiable:
- Never expose partial writes—readers only follow committed snapshot IDs.
- Immutable data files—updates are new files + metadata, not rewrite-in-place of objects mid-read.
- CAS is the commit boundary—files without a winning snapshot are garbage (subject to cleanup).
- Time travel = old snapshots still referenced—don't expire while readers/jobs need them.
- Honest scope—this is table-level ACID, not a distributed XA across gold+silver."
C — Constraints (second C)
| Constraint | Design response |
|---|---|
| No native multi-file S3 transaction | Table format metadata + catalog CAS |
| Concurrent writers | Optimistic commit + retry; or partition ownership |
| Small files / many manifests | Compaction / OPTIMIZE / rewrite_data_files |
| Cross-table consistency | Orchestrate job order (silver before gold); not format XA |
| Engine mix | Prefer Iceberg for neutrality; Delta if Databricks-heavy |
| Deletes / GDPR | MERGE + compaction; snapshot expiration policies |
E — Evolution (ops + formats)
Phased delivery:
| Phase | Deliverable |
|---|---|
| M1 | Bronze table format on S3; single-writer append; catalog |
| M2 | Concurrent writers + conflict retry; snapshot history / time travel |
| M3 | Silver MERGE idempotent on business keys; schema evolution rules |
| M4 | Compaction + snapshot expiration SLOs; metrics on commit conflicts |
| M5 | Multi-engine readers (Trino); governance (row/column policies) |
Failure modes I'd mention:
| Failure | Mitigation |
|---|---|
| Two writers CAS conflict | Retry with fresh snapshot; serialize hot partitions |
| Orphan files after failed commit | GC / vacuum after retention |
| Metadata explosion | Compaction; fewer files per commit |
| Reader sees "missing" after aggressive expire | Align snapshot retention with longest job |
| "Spark transactions" without table format | Not a lakehouse—add Iceberg/Delta/Hudi |
Observability: commit success/conflict rate, files per snapshot, metadata size, compaction lag, query files scanned.
Closing line (interview)
"So: S3 stores immutable files; the open table format stores snapshots/manifests; the catalog CAS atomically publishes a new snapshot. That gives atomic multi-file commits, snapshot isolation, and durable table state—ACID per table, without a warehouse server. Compaction and conflict retries are the operational price. If you need cross-table transactions or OLTP latency, that's a different system."
Scoring signals
| Strong | Weak / red flag |
|---|---|
| Separates S3 durability from table-format ACID | "Parquet on S3 is ACID" |
| Describes upload-then-CAS commit | "Spark supports transactions" with no metadata story |
| Snapshot isolation for readers | Claims serializable cross-table XA |
| Concurrent writer = conflict + retry | Ignores concurrent writes |
| Compaction / small files | Never mentions ops cost |
| Names Iceberg/Delta/Hudi | Vague "lakehouse product" |
Compact outline (if time-boxed to 2 minutes)
"Object storage ≠ multi-file atomicity. Iceberg/Delta/Hudi: write immutable Parquet, then CAS catalog snapshot pointer. Readers pin one snapshot—no torn reads. Concurrent writers: optimistic CC, loser retries. ACID is table-level snapshot isolation + durable objects. Compaction required. Not cross-table XA, not OLTP."
24. Weak Answer Example
Question: "How does a lakehouse provide ACID on object storage?"
"We store Parquet on S3 and use Spark, so we have a lakehouse with ACID because Spark supports transactions."
Why weak / red flags: No open table format, no metadata/CAS commit story, ignores concurrent writers and small files—Parquet-on-S3 alone is not a lakehouse.
25. Hands-On Exercise
- Create local MinIO or cloud bucket; write Iceberg or Delta table with Spark.
- Run two concurrent append jobs; observe commit conflict behavior.
- Query
historyor snapshots; run time-travel SELECT. - Generate small files; run compaction; compare query plan file counts.
- Sketch medallion DAG for a sample ecommerce dataset.
26. Knowledge Check
- Atomic commit mechanism? (Metadata CAS / snapshot swap.)
- Medallion middle layer? (Silver—cleaned/conformed.)
- Reader isolation model? (Snapshot isolation.)
- Small file problem cause? (High-frequency small writes.)
- Open formats named? (Iceberg, Delta, Hudi.)
- Bronze layer purpose? (Raw ingest preservation.)
- Time travel enables? (Audit and rollback.)
- MERGE use case? (Upserts and deduplication.)
- Catalog role? (Table metadata resolution.)
- Lakehouse weak for? (OLTP low-latency writes.)
27. Flashcards
| Front | Back |
|---|---|
| Lakehouse | Lake storage + warehouse semantics via table formats |
| Open table format | Metadata spec for ACID on object files |
| Medallion | Bronze → silver → gold layering |
| Snapshot | Point-in-time consistent table view |
| Compaction | Merge small files for scan efficiency |
| CAS commit | Compare-and-swap metadata for atomicity |
| Iceberg | Netflix-originated open table format |
| Delta Lake | Databricks-originated table format |
| Time travel | Query historical snapshots |
| Partition pruning | Skip files via partition metadata |
28. Cheat Sheet
LAKEHOUSE STACK
Engines (Spark/Flink/Trino) → Table format → Parquet on object storage
ACID ON S3
Write files → CAS metadata snapshot → readers pin version
MEDALLION
Bronze: raw | Silver: clean | Gold: curated
OPS MUST-HAVES
Compaction, snapshot expiry, orphan cleanup, commit retry
WHEN NOT
OLTP, tiny data, no ops maturity
PRINCIPAL ANCHORS
Format choice = engine + catalog lock-in
Compaction is production SLO work
Medallion contracts between layers
Governance enforces across engines
Time travel ≠ free storage
Commit conflicts are normal at scale
FinOps: gold smaller than bronze
Hybrid warehouse+lake common at enterprise scale
29. Related Concepts
- Storage Engine Fundamentals — files, indexes, and durability primitives
- ACID and Isolation — transactional semantics
- Event-Driven Architecture — streaming ingest to bronze
- Stream and Batch Processing — pipeline execution models
- Data Governance and Lineage — catalog and policy layers
- Apache Iceberg specification — primary format reference
30. References
Primary sources
- Armbrust, M., et al. (2021). Lakehouse: A New Generation of Open Platforms that Unify Data Warehousing and Advanced Analytics. CIDR.
- Apache Iceberg, Delta Lake, Apache Hudi official documentation — format semantics and guarantees.
Related systems
- Databricks Lakehouse documentation — medallion and Delta implementation choices.
- Netflix Iceberg engineering blogs — production scale lessons.
Distinction
| Claim type | Source |
|---|---|
| Snapshot isolation semantics | Format specifications |
| Medallion pattern | Databricks/industry practice—organizational convention |
| Performance numbers | Workload-specific; do not generalize |