GenStage vs Processes


I’m designing a system with recurrent long processing jobs from an API, and I wondering if GenStage or use multiple process (one process per request,i.e DynamicSupervisor) suite more for this kind of use case.

Is it better to use multiple process (one per request) or leverage the backpressure from genstage to support concurrent requests ?

For example:

Using Multiple process (ie. DynamicSupervisor)

API -> Job -> Job,Job,Job
    -> Job -> Job,Job,Job

Using GenStage

API -> Producer -> ProducerConsumer -> Consumer


You can sort of do both with ConsumerSupervisor.

1 Like