Backward Compatibility
The ability of a newer version of a system to keep working with the data, interfaces and clients that were built for older versions.
Also known as: Backwards Compatibility, Backward Compatible, Downward Compatibility
Category: Software Development
Tags: software-development, software-engineering, compatibility, api-design, software-architecture, maintainability
Explanation
A system is backward compatible when what worked yesterday still works after the upgrade. A new version of a file format opens old files. A new version of an API still answers old clients. A new processor runs old programs. The new side takes on the burden of understanding the old one.
**Examples**:
- **x86 processors**: A current CPU can still run code written for chips from the 1980s
- **The web**: Pages from the 1990s still render in today's browsers. "Don't break the web" is an explicit rule of web standards
- **USB**: A USB 2.0 device works in a USB 3.0 port
- **Windows**: Decades of effort went into keeping old applications running
- **Counter-example**: Python 3 broke compatibility with Python 2 on purpose. The migration took the community more than a decade
**Rules of thumb for APIs and data formats**:
- **Safe**: Add an optional field, add a new endpoint, accept more input than before
- **Not safe**: Remove or rename a field, change a type, make an optional input mandatory, tighten validation, change the meaning of an existing value
- Changing behavior that nobody documented can still break people (see Hyrum's Law)
**Why it matters**:
- Users can upgrade without rewriting what they have. That lowers the cost of adoption
- Trust: a platform that breaks its users teaches them not to build on it
- In distributed systems you can't upgrade everything at once. Old and new versions have to work together during the rollout
**The price**:
- Old mistakes stay. Every design decision you can't undo adds complexity and attack surface
- Testing grows with every version you still support
- At some point the accumulated weight slows everything down. That's when deprecation and a deliberate breaking change become the better option
Backward compatibility is a promise about the past. Its sibling, forward compatibility, is a bet on the future: old software that tolerates what newer versions produce.
Related Concepts
← Back to all concepts