Table of Contents

Semantic Version Management (Semantic Versioning)

Introduction

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:

Basic Principles

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.

The logic behind the version number

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

Version increment decision process

Increasing the version is not random, but a rule-based decision.

flowchart TD A["A change occurred"] --> B{"Compatible?"} B -- "No" --> C["Increase MAJOR"] B -- "Yes" --> D{"New feature?"} D -- "Yes" --> E["Increase MINOR"] D -- "No" --> F["Increase PATCH"]

The three version levels in detail

MAJOR version

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:

MINOR version

Increasing the MINOR version means introducing new features that do not break existing operation.

Examples:

Important:

PATCH version

Increasing the PATCH version serves exclusively for bug fixes.

Examples:

This is the safest update type.

Lifecycle of versions

0.x.x – development phase

1.0.0 – stable release

This is the point where:

Pre-releases and metadata

Pre-release

1.0.0-alpha
1.0.0-beta.1
1.0.0-rc.1

Meaning:

Build metadata

1.0.0+build.123

Characteristics:

Comparing versions

The ordering of versions happens according to the following logic:

  1. MAJOR → MINOR → PATCH
  2. then pre-release

Important:

Important rules

Practical significance in integration

Semantic versioning is especially important in the following cases:

Advantages:

Example of version evolution

 1.2.3 → bugfix → 1.2.4 1.2.3 → new feature → 1.3.0 1.2.3 → breaking change → 2.0.0 

Summary

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.