Evolving APIs Without Breaking Clients.
Learner, Love to make things simple, Full Stack Developer, StackOverflower, Passionate about using machine learning, deep learning and AI
Search for a command to run...
Learner, Love to make things simple, Full Stack Developer, StackOverflower, Passionate about using machine learning, deep learning and AI
No comments yet. Be the first to comment.
Hard-earned lessons on why breaking changes cause real damage in production, and how experienced engineers design new features that respect the past.
Why schema changes break production and how experienced teams avoid it. Introduction: Databases remember everything You can redeploy code in minutes.You can roll back services.You can toggle feature flags. But your database? It remembers every decis...
Move beyond traditional RESTful thinking. Learn how to design APIs specifically for MCP (Model Context Protocol) servers. This guide covers the shift in mindset, a practical OpenAPI 3.1 example, and a Spring Boot implementation to make your services ...

Extending Kestra to Every Corner of Your Data Stack. Introduction: The Power of Plugins Imagine you're a master chef. You don't just have one knife - you have specialized tools for every task: a paring knife for delicate work, a chef's knife for chop...
Mastering Complex Orchestration Scenarios. Introduction: The Orchestrator's Toolkit Imagine you're conducting a symphony. You don't just wave your baton - you cue sections, adjust tempo, handle surprises, and ensure harmony. That's what advanced work...
From Data Extraction to Loading - A Practical Guide Introduction: Why ETL Still Matters in the Modern Data Stack Remember when data engineering was "extract, transform, load"? Some say ETL is dead, replaced by ELT, reverse ETL, and data mesh. But her...
Building Blocks of Declarative Orchestration. Introduction: The Power of Simplicity Imagine trying to build a house without understanding bricks, beams, and blueprints. That's what using an orchestration tool without understanding its core concepts f...
Why API changes fail in production and how experienced teams avoid it.
Read first article from series is here.
The moment you publish an API, it stops being just your code.
It becomes:
Someone else’s dependency
Someone else’s release risk
Someone else’s production problem
Most API failures don’t come from load or latency.
They come from unexpected change.
If backward compatibility is hard in general, APIs make it harder—because your consumers are often invisible to you.
You rarely know:
Who is using your API
How often they call it
What assumptions they made
How quickly they can upgrade
Even inside the same company:
Teams move on
Ownership changes
Documentation becomes outdated
Designing APIs means designing for uncertainty.
An API contract is not just:
Endpoint URL
HTTP method
Request and response fields
It also includes:
Field meanings
Validation rules
Default values
Error behavior
Ordering and timing
Breaking any of these can break clients—even if the JSON still “looks valid”.
Original response:
{
"total": 5
}
Later change:
{
"total": "5"
}
Everything still parses.
But:
A strongly typed client fails
Calculations behave incorrectly
Bugs appear far from the API
Lesson:
Data type changes are breaking changes—even if they seem harmless.
The safest API evolution strategy is addition.
You can safely:
Add optional fields
Add new endpoints
Add new error codes
Clients that don’t know about them simply ignore them.
Instead of changing:
{
"amount": 1000
}
Add:
{
"amount": 1000,
"pricing": {
"value": 1000,
"currency": "INR"
}
}
Old clients keep working.
New clients get richer data.
This is boring design.
And boring is good.
If the meaning of a response changes, versioning is not optional.
Originally:
Later:
Same endpoint. Same request. Different outcome.
This is a breaking change—even if the response schema is unchanged.
Correct approach:
/api/v1/orders → old behavior
/api/v2/orders → new rules
Versioning is not about structure.
It’s about behavior.
Using one field to represent multiple concepts.
{
"status": "FAILED"
}
Does it mean:
Validation failed?
Payment failed?
System failed?
Clients guess.
Guessing leads to bugs.
Today:
{
"email": "user@test.com"
}
Tomorrow:
{
"email": "user@test.com",
"phone": "9999999999"
}
If phone becomes required:
Old clients fail validation
Deployments break unexpectedly
Rule:
Once optional, always optional—at least in the same version.
Validation changes break more clients than schema changes.
Example:
Previously allowed empty string
Now rejects it
Same field. Same API. Different outcome.
This breaks clients silently.
APIs should be forgiving at the edges.
Accept:
Missing optional fields
Extra fields you don’t understand
Slightly older formats
Reject only when:
Data is invalid
Security is at risk
Business rules truly require it
Strict input + no versioning = production pain.
Changing error behavior is a breaking change.
Old:
{
"error": "INVALID_REQUEST"
}
New:
{
"errors": [
{ "code": "INVALID_REQUEST" }
]
}
Cleaner? Yes.
Backward compatible? No.
Clients parse errors too.
They do three things consistently:
Design APIs as public contracts
Assume clients upgrade slowly
Measure usage before removing anything
They treat APIs like products—not internal functions.
Before you change an API, ask:
Will old clients still work?
Are we changing behavior or just adding data?
Can this be done additively?
Do we need a new version?
How long will we support the old one?
If the answer is unclear, don’t change it yet.
Most systems don’t fail at the core logic.
They fail at the boundaries—where assumptions meet reality.
APIs are those boundaries.
Design them carefully, evolve them slowly, and never forget:
Once an API is used, it no longer belongs only to you.
More such articles:
https://www.youtube.com/@maheshwarligade