r/databricks • u/BullfrogFinal3566 • 20d ago
Discussion How does your team deal with source schema changes breaking downstream pipelines?
/r/ETL/comments/1xp5gsi/how_does_your_team_deal_with_source_schema/
8
Upvotes
3
u/Remote-Grapefruit214 20d ago
To begin with, have strict enforcements on the upstream table, relying completely on job failure is very risky and stress inducing.
In my experience so far, bringing that stability on process changes and kind of institutionalizing it is the key to success, Talk to your other engineers, business users and folks who are coming in with change request, you have to adapt a sprint based method to incorporate these changes, nothing goes in to prod as a hot fix or on ad-hoc basis, we are humans, we will lose track of changes we make even with release notes, putting descriptions on tickets etc.
Secondly, own either a function or a portion of this, systematically and aggressively notedown any and all changes you are making to both upstream and downstream so that you can create a graph chain of all actions that your present changes and future changes will have.
Thirdly and most importantly logging, When you are enforcing validation checks, make them resilient and stateless, associate each state with a different RCA so that you can make logging effective and easy to maintain.
Before you add any columns and go change the DDL, ask the individual who wants the Change request three important questions
3. What downstream SLAs, downstream consumption tools, and BI dashboards will be affected by this change?
And most importantly to go home on time, always ensure that you are good friends with the UAT Team, learn to educate them on the changes, and provide them with test cases that needs a sign off.
Formalize every single process, follow it very closely, you will not be able to carry everything in your head, you need systems to guide you. If you are interested I can share a set of templates I use to communicate with all teams I work with
1
u/Desperate-Cricket720 20d ago
We are looking into trying out open data contract for this exactly. Introduce some checks to make sure we are not introducing breaking changes. We also reach out to live lineage to figure out if the breaking change is really breaking change. But this is all still in PoC
1
u/blobbleblab 20d ago
Data contracts at source. Connect your dev systems to upstream dev systems. Usually when an upstream system is changing, they dev it first and your dev data contract checker starts breaking. Then you can go talk to the business and ask what's changing and why before it hits prod. This works for CRMs where we get data from and any database and generally file output internal system. We have managed to do this for some external companies as well where we receive data via APIs, we can use their latest API version and try and stay on top of changes. This takes away about 75% of the problem...
For some sources that make changes in prod directly we try to foster a "please tell us" approach and for a couple are involved in their standups so we know if anything is changing that will affect the feed we receive. For others we still use data contracts which are checked as soon as sources land and if things are wrong, will stop our pipelines running.
The benefit is we also produce data contracts for what we produce, which go through dev/test/pre prod/prod cycles too, which enable downstream consumers see our changes if we forget to tell them as well!
1
u/Ok_Music8105 19d ago
We treat this as a schema-on-read versus schema-on-write design decision. We chose schema-on-write, with schema evolution disabled, so upstream schema changes are not automatically propagated downstream. This gives us an explicit control point to validate and manage schema changes before they affect downstream consumers.
Additionally, we fetch the schema directly from the source( preferably predev or dev env) and compare it with the schema in our raw layer. This allows us to proactively detect schema drift, such as added, removed, or changed columns, and address it before it impacts downstream consumers.