61. How do ETL and ELT differ?
A source emits raw customer events and the destination is an analytical lakehouse or warehouse. Compare transforming before load with loading immutable raw data before transformation. Address freshness, schema and PII validation, compute location, lineage, replay and backfill, cost, security, and consumer isolation. State the source and curated contracts and how each approach recovers from a partially failed transformation.
ETL transforms before loading curated data, while ELT loads immutable raw data first and transforms it inside the lakehouse or warehouse. ETL favors earlier validation and PII removal. ELT favors easier replay, backfills, schema evolution, and reuse of raw data.
The question asks when customer information should be cleaned and changed before people use it for reports or analysis. One design changes the information first and stores only the finished result. The other stores the original information safely first and changes it later. You should compare how quickly results arrive, where the work happens, what is stored, how private information is protected, how much each design can cost, how people are kept away from unfinished data, and what happens if part of the work fails. You should also explain the rules for the original and finished information.
- Is the destination mainly a lakehouse, a warehouse, or a platform that supports both raw and curated storage?
- What freshness target do consumers need: batch delivery in minutes or hours, or near-real-time delivery?
- Are we allowed to retain raw PII, and what encryption, access-control, masking, and retention rules apply?
- Must historical data be replayable when transformation logic or the source schema changes?
- Should consumers have access only to curated data, or may restricted engineering users also access the raw layer?
Start with the practical difference. ETL means Extract, Transform, Load. The pipeline ingests source events, transforms and validates them in staging or pipeline compute, and then loads curated data into the analytical lakehouse or warehouse. ELT means Extract, Load, Transform. The pipeline first stores an immutable raw copy, then performs the main transformations using compute inside the warehouse or lakehouse.
In the diagram, the source contract represents customer events serialized as JSON and delivered through HTTPS or Kafka. Required fields include event_id, customer_id, event_type, event_time, and payload. event_time is an ISO 8601 UTC event timestamp. Producer ordering is best effort, duplicate events are possible, and the source schema is versioned so it can evolve.
For ETL, ingestion performs schema validation, identifies PII patterns, and applies basic quality checks. The staging transformation layer then cleans and validates the events, conforms types, applies business rules, enriches data when necessary, deduplicates records, and handles PII before curated data is loaded. The transformation compute is outside the analytical warehouse in the ETL pipeline or staging environment.
The main ETL benefit is early control. Invalid data or sensitive fields can be rejected, removed, masked, or transformed before the curated analytical store is written. Because only curated data may be retained in the destination, storage can be lower and the PII blast radius can be smaller. Consumers receive curated-only access by default.
The ETL tradeoff is replay. If the transformation logic changes, rebuilding history is harder when the raw input was not retained. Recovery may require replaying the source or reading retained staging snapshots. For a partially failed ETL transformation, fix the transformation logic, identify the affected window, restart from a valid checkpoint or retained staging input, and perform idempotent writes to the target curated partitions. Then rerun quality checks and verify lineage before making the corrected data available.
For ELT, ingestion first appends the source events to an immutable raw landing layer. The raw layer keeps the original columns and is not updated or deleted as part of normal transformation processing. It can be partitioned by event_date and stored in analytical formats such as Parquet or JSON according to the platform design. The main transformations then run inside the warehouse or lakehouse using its compute engine, for example SQL, dbt, or Spark where those technologies are available.
The ELT transformation cleans, validates, enriches, deduplicates, and handles PII, then writes curated tables or views. Transformation output should be deterministic and idempotent so retrying the same input produces the same logical curated result instead of creating duplicates.
ELT makes replay and backfill easier because the immutable raw input remains available. If a transformation fails, fix the SQL or transformation logic, identify the failed raw partitions or event-time range, rerun only that input, and overwrite or safely merge the affected curated partitions. Then verify quality checks and lineage. The raw data does not need to be recovered from the producer because it was already retained.
Freshness depends on the implementation rather than the acronym alone. In the diagram, ETL commonly delivers batch freshness in minutes to hours, although streaming ETL is possible and can be more complex. ELT can support near-real-time to minute-level freshness when ingestion, transformation frequency, and warehouse or lakehouse capacity support it. Neither pattern automatically guarantees a particular latency.
The curated contract should be consistent for consumers regardless of whether ETL or ELT produced it. In the diagram, the curated grain is one row per logical event identified by customer_id, event_type, event_time, and event_id. The schema uses stable typed columns with surrogate keys where appropriate. Data is partitioned by event_date in UTC, event_id is deduplicated, PII is handled according to policy, and the target freshness SLA is under 15 minutes for the illustrated design. Consumers receive read-only access through governed tables or views, with row-level or column-level security where needed.
Quality checks apply to both approaches. They include schema validation, completeness checks such as null and range checks, uniqueness of event_id, timeliness or late-data thresholds, referential checks where applicable, and PII scans or masking. These checks help prevent silent loss, duplication, invalid records, or sensitive-data leakage.
Lineage should record the path from the source to the final curated datasets and consumers. ETL typically records source to staging to curated. ELT records source to raw to curated. Keeping raw lineage in ELT is especially useful when rebuilding data after transformation changes.
Security differs mainly in when sensitive raw data is retained. ETL can remove or mask PII before it reaches the analytical destination. ELT may store PII in the raw layer, so raw storage requires encryption, strict access controls, auditing, masking or tokenization where appropriate, and retention policies. Raw and curated areas should be isolated, and ordinary BI or data-science consumers should normally receive access only to curated data.
Cost also moves to different places. ETL may use more external pipeline compute but can store less raw data. ELT stores more data because it keeps the raw copy and uses warehouse or lakehouse compute for transformations. In return, ELT can reduce the operational effort needed to replay historical data, backfill changed logic, or support new downstream use cases.
The practical choice depends on requirements. Choose ETL when early validation or PII removal is especially important and storing raw data in the analytical destination is undesirable. Choose ELT when immutable raw retention, replayability, backfills, schema changes, lineage, and flexible reuse are priorities. Both patterns should expose the same trusted curated contract to consumers, isolate incomplete or raw data, track lineage, run quality checks, and recover with deterministic idempotent writes.
- Define the source contract: JSON event structure, required fields, event-time semantics, schema version, best-effort producer ordering, duplicate behavior, and PII fields.
- Define the curated contract that consumers should receive regardless of ETL or ELT, including grain, typed schema, partitioning, deduplication rule, freshness target, PII policy, and access controls.
- For ETL, ingest the events, validate schema and PII, transform in staging or ETL compute, then load only curated data into the analytical destination.
- For ELT, ingest and append immutable raw data first, then transform it using warehouse or lakehouse compute into the curated layer.
- Deduplicate deterministically by event_id and make curated writes idempotent so retries do not duplicate logical events.
- Track lineage from source through staging or raw storage to curated datasets and consumers.
- Run schema, completeness, uniqueness, timeliness, referential, and PII checks where applicable.
- Isolate consumers from raw, staging, and partially completed outputs; expose governed curated tables or views.
- On an ETL failure, restart the affected window from the source, checkpoint, or retained staging snapshot and safely rewrite the affected curated partitions.
- On an ELT failure, rerun the affected immutable raw partitions and safely overwrite or merge the corresponding curated partitions.
- Compare freshness, compute location, storage cost, transformation cost, replayability, security, schema volatility, and operational complexity before choosing the pattern.
ETL usually spends more transformation compute before data reaches the warehouse or lakehouse and may store less raw data there. Historical replay can require more operational work if the source or staging input was not retained. ELT stores an extra immutable raw copy and uses analytical-platform compute for transformations, so raw-storage and warehouse or lakehouse compute costs can be higher. In exchange, replay and backfill are usually simpler because the original input is already stored. Both approaches also require ongoing work for orchestration, data-quality checks, lineage, monitoring, security, retention, retries, and maintenance of idempotent transformation logic.
This question tests whether the candidate understands the operational difference between transforming before load and loading raw data before transformation. The interviewer is looking for judgment about freshness, schema and PII validation, compute location, lineage, replay and backfill, cost, security, consumer isolation, data contracts, and deterministic recovery after a partial transformation failure.
A common mistake is saying ETL is always batch and ELT is always real time. Either pattern can use batch or streaming components, and freshness depends on the implementation. Another mistake is assuming ELT performs no validation during ingestion; basic contract and security checks can still happen before raw data is accepted. Candidates also forget that retained raw PII requires stronger controls, or that ETL replay becomes difficult if neither the source nor staging input can be replayed. Another mistake is treating retries as simple appends. Reprocessing must use deterministic deduplication and idempotent writes so it does not create duplicate curated results. Finally, consumers should not see raw, staging, or partially transformed data merely because the pipeline is still processing.
Lead with the order difference, then immediately explain why it matters. ETL transforms before loading curated data; ELT preserves immutable raw data first and transforms it inside the analytical platform. Compare freshness, schema and PII handling, compute location, lineage, replay, cost, security, consumer isolation, and partial-failure recovery. Finish by explaining that neither pattern is universally better and that safe retries require retained input plus idempotent curated writes.










