A worker process performs a system service, while a supervisor manages process life cycles. Workers provide the actual services of a concurrent system; supervisors detect failures and restart them. section 8.3
Workers can also execute independent operations outside a central server process. One-off workers keep request handling short and allow new requests to proceed concurrently, although unrestricted spawning can overload I/O resources. section 7.3.4
In a supervision tree, workers provide the operational boundaries that make failure and service management tractable:
- Run each worker under a supervisor so a crashed service can be restarted independently. section 9.0
- Group related workers into services such as a database or cache, then organize those services beneath supervisors. section 9.1.6
- Use one-off workers for independent reads or writes when the central process must remain responsive. section 7.3.4
Concurrent database operation
A database server can spawn a worker for a file write and immediately return. For a synchronous read, the worker performs the operation and calls GenServer.reply/2 while the server returns {:noreply, state}. section 7.3.4
A supervision-tree diagram shows workers as service components beneath supervisors, making restart boundaries and failure propagation visible. section 9.1.6








