Designing Systems for Safe and Evolvable Data Schemas

Original Title: SE Radio 741: Sahil Walia on Schema Changes and Data Migrations

Schema evolution is rarely just a technical problem; it is a test of system trust. While developers often view schema changes as routine DDL updates, Sahil Walia points out that these modifications are high-stakes stress tests for organizational coordination. Ignoring this leads to silent data degradation that eventually breaks downstream decision-making. By prioritizing additive changes and decoupling data identity from positional order, architects can turn destructive migrations into routine, safe operations. Shifting from fixing mistakes to designing for evolution provides a competitive advantage: the ability to change business logic without triggering outages across teams.

The Hidden Cost of Flexible Schemas

The industry move toward schemaless or schema-on-read systems was a reaction to the rigidity of traditional relational databases. However, Walia argues that this flexibility shifts the burden of complexity rather than removing it. In a schema-on-write system, the database acts as the arbiter of truth. In a schema-on-read system, that responsibility moves to the consumer.

When teams treat schema as an afterthought, they encounter silent corruption. This happens when the data structure remains technically valid but its meaning shifts, such as changing a currency field from USD to local currency without updating downstream logic.

> When you are a person working with the schemas when you are delivering data or delivering applications you have not only the logical boundary but you also have a trust boundary. If you are delivering applications which do not deliver trust or reliable data or deterministic data in technological terms, you lose that right.
>
> -- Sahil Walia

The systemic implication is clear: the flexibility of modern data lakes often hides a lack of governance. As Walia notes, the risk is not just a failed query; it is the erosion of trust between the data team and the business stakeholders who rely on that data for critical decisions.

The Engineering of Safe Evolution

Walia advocates for a design philosophy where safe migrations are maximized by construction. The most effective way to achieve this is through the use of stable identifiers. In many systems, data is identified by its ordinal position, such as the third column. If you drop the second column, the third shifts, and the entire downstream pipeline breaks.

By decoupling the field name from a permanent, unique ID, a pattern seen in technologies like Protobuf and Apache Iceberg, architects can ensure that the system retains its reference point even if a column is renamed or moved.

> The art of scheme evolution is making the safe category as large as possible that is by your definition unsafe, like removing a field or it is destructive.
>
> -- Sahil Walia

This approach requires upfront effort that most teams find uncomfortable. It demands rigorous CI/CD pipelines, schema registries, and a deep understanding of downstream consumers. However, this discomfort creates a long-term advantage: while competitors struggle with fragile, manual migrations that require downtime, organizations that invest in stable identifiers can evolve their data structures iteratively and safely.

Designing for the 18-Month Horizon

A common trap in schema design is over-modeling, or creating 100 columns today to avoid a migration tomorrow. Walia warns against this, noting that unused columns often lack proper governance, masking, or access control. This creates a security and operational liability that is often worse than the original migration risk.

Instead, the system should handle additive changes gracefully. If the architecture is built on columnar storage, the cost of adding or changing a field is isolated to that specific column, rather than requiring a full table rewrite. This allows teams to align their technical evolution with the natural cadence of business requirements, rather than forcing the business to conform to rigid, brittle storage constraints.

Key Action Items

  • Implement Stable Identifiers: Audit your current data formats, such as Avro, Protobuf, or Iceberg. If your system relies on ordinal positioning, prioritize refactoring to use permanent field IDs. (12-18 months)
  • Decouple Schema from API: Distinguish between the shape of your data and the operations performed on it. Use versioning for APIs to allow for breaking changes without impacting existing consumers. (Immediate)
  • Establish Safe Migration Patterns: Move away from destructive alter table operations. Adopt blue-green table swaps or replication-based migrations to maintain availability during large-scale data shifts. (Next quarter)
  • Shift-Left Governance: Integrate schema linting and registry checks into your CI/CD pipeline to catch breaking changes before they reach production. (Immediate)
  • Conduct Workload Testing: For petabyte-scale migrations, do not rely on staging environments. Use a production-mirror environment to validate that your migration logic can keep pace with live write throughput. (Next quarter)
  • Prioritize Additive Changes: When evolving schemas, aim for additive changes that are backward compatible. Treat non-additive changes as high-risk events requiring explicit cross-team coordination. (Ongoing)

---
Handpicked links, AI-assisted summaries. Human judgment, machine efficiency.
This content is a personally curated review and synopsis derived from the original podcast episode.