Handle source schema changes without downtime
schema-evolution strategy.
add columns as nullable additive changes, version the schema, use formats like Iceberg or Parquet that support evolution, backfill new types safely.
an in-place destructive ALTER that breaks readers.
What's really being asked
Whether you understand schema evolution as a versioned, mostly additive discipline rather than a risky in-place mutation, and whether you can keep producers and consumers working across the transition without losing history.
The full answer
Distinguish additive from breaking changes. Adding a new column is backward compatible: define it as nullable with a default so existing queries and old files that lack it still read correctly. The data-type change is the harder case. Avoid mutating existing data in place. Prefer a table format built for evolution, such as Apache Iceberg, Delta Lake, or Hudi, which track schema by column id and support safe type promotions like int to long. When a change is not a safe promotion, add a new typed column, backfill it from the old one, validate, then deprecate the old column. Version the schema in a registry, validate incoming records at ingest, and route nonconforming rows to a dead-letter or quarantine area instead of dropping them.
The mistakes people make
Running a destructive ALTER COLUMN that rewrites the whole table, blocking readers and risking truncation. Silently dropping records that no longer match. Assuming all consumers update at the same instant.
What usually comes next
How does column-id-based evolution differ from name-based? What is a safe versus unsafe type promotion? How do you coordinate the cutover with downstream teams?
A concrete example
A source promotes an amount field from integer to decimal and adds a currency column. The engineer adds currency as nullable, and because the table is on Iceberg, applies the int-to-decimal change as a tracked schema update without rewriting old files. New writes carry the new types, old files still read, downstream jobs are migrated one by one, and nothing is lost.
Interview question
Why is adding the new column as nullable preferable to a destructive in-place rewrite of the table?
- a.Existing readers and old files keep working while the change is additive and backward compatibleCorrect
- b.In-place rewrites are not supported by any warehouse
- c.It forces all downstream consumers to upgrade simultaneously
- d.Nullable columns are always faster to query than non-nullable ones
Why? this is the answer
An additive nullable column is backward compatible, so old readers and files keep functioning without a coordinated cutover. Nullability does not inherently speed queries, and rewrites are supported, just risky.
Just read this? Test yourself on what you have been reading.
Read the original → iceberg.apache.org
- #schema-evolution
- #data-pipeline
- #iceberg
- #data-warehouse
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles