0Pricing
Elixir & Phoenix: Scalable Backend Development · Lesson

Dynamic Supervisors and Registry

Learn to dynamically start and stop processes with `DynamicSupervisor` and use `Registry` for process lookup.

Dynamic Process Management

In previous lessons, we learned about supervisors for managing a fixed set of processes. But what if your application needs to create or destroy processes on demand, like for each user session or a specific task?

This is where dynamic process management comes in handy. It allows your application to adapt and scale by creating processes only when they are needed.

Introducing DynamicSupervisor

Elixir's DynamicSupervisor is designed precisely for this purpose. Unlike Supervisor, which manages a predefined list of children, a DynamicSupervisor starts with no children.

It provides functions to dynamically add and remove child processes during runtime, giving you flexible control over your application's process tree.

All lessons in this course

  1. Distributed Elixir and Clustering
  2. Advanced Supervisor Strategies
  3. Dynamic Supervisors and Registry
  4. GenStage and Backpressure Pipelines
← Back to Elixir & Phoenix: Scalable Backend Development