Schema evolution treats a schema as a versioned contract rather than a permanent description of data. The contract includes field names, types, nullability, nested structures, and sometimes defaults or identifiers. A change must be evaluated against both stored records and running applications: accepting a new record does not necessarily mean that an older transformation or dashboard can interpret it correctly.
Compatibility has a direction. Backward compatibility means that a new reader schema can read data written with an older schema. Forward compatibility means that an older reader schema can read data written with a newer schema. Full compatibility requires both. The exact rules depend on the serialization format, table format, and reader implementation. Adding an optional field is often compatible, but required fields, default values, unknown-field handling, and type conversions must be checked. Transitive compatibility checks extend beyond the immediately preceding version to earlier registered versions.
When integrating multiple sources, first establish a canonical schema and explicit mappings. For example, one customer source might send customer_id as an integer while another sends alphanumeric identifiers as strings. Converting both to a sufficiently capable string representation can preserve values, but blindly casting the second source to an integer can fail or discard information. Similarly, timestamps require agreement about time zones and precision, and monetary values require consistent currency and decimal scale. Structural compatibility alone does not guarantee semantic compatibility.
A practical rollout might add a nullable loyalty_tier field to an orders dataset. Update the destination and readers to tolerate the field before producers begin populating it. Historical records can remain without the value if readers correctly interpret its absence; backfill them only when business requirements demand it. A rename requires more care because a name-based system may interpret it as removing one field and adding another. A staged transition can publish both names temporarily, update consumers, and retire the old name after dependencies have migrated.
Open table formats such as Apache Iceberg make schema changes explicit table metadata operations. Iceberg tracks columns using stable field identifiers, allowing supported renames and reordering without confusing one column with another. Supported additions, deletions, and type promotions can generally occur without rewriting existing data files. However, arbitrary type changes are not safe promotions, and metadata-only changes do not convert historical values or update application code. Supported operations also depend on the engine and connector. Partition evolution is a separate capability and should not be confused with changing a table's column schema.
In a cloud data lake, distinguish the physical file schema, the catalog schema, and the schema expected by each processing job. Updating a catalog does not rewrite Parquet files or repair incompatible partitions. AWS Glue crawlers can discover schemas and populate the AWS Glue Data Catalog, but discovery is not a compatibility guarantee. Configure crawler grouping and schema-change behavior deliberately; for controlled datasets, consider logging detected changes instead of automatically replacing production definitions. Validate inferred types against representative files, especially when fields are sparse or vary between source versions.
When transformations fail, compare the incoming records, file metadata, catalog definitions, and job schema. Common causes include strings appearing in numeric fields, nested objects replacing scalar values, missing required fields, incompatible partition schemas, and casts that overflow. Preserve failing records in a quarantine location with diagnostic information rather than silently converting every error to null. Test old and new records together, monitor rejected-record and unexpected-null counts, and distinguish genuine schema changes from malformed data.
Automatic schema merging reduces manual work but can increase planning time and metadata reads across many files. Repeated inference, unnecessary casts, and mixed physical types can also increase processing cost or prevent efficient reads. Prefer explicit schemas for stable production interfaces and use discovery to detect drift. Schema-on-read does not eliminate evolution work: it moves compatibility decisions to readers. A reliable approach combines versioned contracts, compatibility tests, controlled catalog updates, staged deployments, and backfills only when required.