The main difference is that Agent (or GenServer) runs in it’s own process.
This means that knowing the pid of Agent (or it’s registered name) you can retrieve/save state from different concurrent processes.
You can use Agent to say implement a dynamic configuration for the application. All HTTP requests are handled in their own processses, but they would be able to access this shared configuration. Then, you could update the configuration say from iex shell and it would be picked up by all other processes now on.






















