0PricingLogin
Erlang OTP: Distributed & Fault-Tolerant Systems Programming · Lesson

Hot Code Loading & Upgrades

Explore Erlang's unique capability for hot code loading and perform live software upgrades on running systems without interruption.

What is Hot Code Loading?

Erlang's hot code loading is a standout feature! It lets you update a running application's code without stopping it. Imagine changing parts of a website's backend while it's actively serving users, without any downtime!

This capability is crucial for systems that need to run continuously, like telecommunications switches or large-scale distributed services. It ensures maximum uptime and service availability.

How Erlang Manages Code

The Erlang Virtual Machine (BEAM) manages code modules in a unique way. For each module, it can keep two versions loaded in memory: an 'old' version and a 'new' version.

  • When a process starts, it runs the 'new' version of the code.
  • If you reload a module, new calls to its functions will use the very latest 'new' version.
  • However, existing processes continue to execute the code they were loaded with until they make a call to a function in the *reloaded* module or are explicitly told to change.

All lessons in this course

  1. Creating Erlang Releases
  2. Hot Code Loading & Upgrades
  3. Release Versioning & Deployment
  4. Release Configuration & Boot Scripts
← Back to Erlang OTP: Distributed & Fault-Tolerant Systems Programming