💧 Elixir Beginner

What is OTP in Elixir?

Answer

OTP (Open Telecom Platform) is a set of libraries, behaviors, and design principles for building fault-tolerant, concurrent systems in Erlang/Elixir. Despite the name, it is not specific to telecom — it is the standard framework for production Elixir/Erlang systems. Key OTP components: GenServer: a generic server behavior for stateful processes. Supervisor: monitors child processes and restarts them according to a strategy when they crash. Application: packages a set of processes into a deployable unit. Agent: simple stateful process (thin wrapper over GenServer). Task: run a single computation asynchronously. Registry: process name registration. OTP transforms the "let it crash" philosophy into a structured supervision tree — instead of defensive error handling, processes crash cleanly and supervisors restart them. Systems built with OTP can achieve extremely high uptime (Erlang/OTP systems have legendary 9-nines availability records).