In modern IT systems, especially in the case of microservice architectures, APIs, and libraries, it is critically important that different components remain compatible with each other. Semantic Versioning (SemVer for short) is a standardized approach that carries information about the nature of changes through version numbers.
The goal of SemVer:
The semantic version format is:
MAJOR.MINOR.PATCH
where:
| Element | Meaning | When do we increase it? |
|---|---|---|
| MAJOR | major version | in the case of an incompatible change |
| MINOR | minor version | in the case of a new, compatible feature |
| PATCH | patch | in the case of a bug fix |
Each element of the version number is a non-negative integer, and changes in increasing order.
One of the most important ideas of SemVer is that the version number is a communication tool between developers.
Example:
1.2.3 → stable API
1.2.4 → same API, only a bug fix
1.3.0 → new features, but old code still works
2.0.0 → major version change → old code may break
Increasing the version is not random, but a rule-based decision.
Increasing the MAJOR version means that a change occurred in the system that is not backward compatible.
Examples:
This is the most critical type of change, because:
Increasing the MINOR version means introducing new features that do not break existing operation.
Examples:
Important:
Increasing the PATCH version serves exclusively for bug fixes.
Examples:
This is the safest update type.
This is the point where:
1.0.0-alpha 1.0.0-beta.1 1.0.0-rc.1
Meaning:
1.0.0+build.123
Characteristics:
The ordering of versions happens according to the following logic:
Important:
Semantic versioning is especially important in the following cases:
Advantages:
1.2.3 → bugfix → 1.2.4 1.2.3 → new feature → 1.3.0 1.2.3 → breaking change → 2.0.0
Semantic versioning is a simple but extremely effective method for tracking the evolution of software in a structured and understandable way, while minimizing integration risks and increasing system reliability.