私は resque を使用して、2 種類のジョブをバックグラウンド処理しています。
(1) 3rd-party API requests
(2) DB query and insert
2 つのジョブは並行して処理できますが、各ジョブ タイプ自体は順番にしか処理できません。たとえば、DB 操作は順番に実行する必要がありますが、サード パーティの API 要求と並行して実行できます。
これを実行するには、次のいずれかの方法を検討しています。
(1) Having two queues with one queue handling only API requests and the other queue
handling only db queries. Each queue will have its own worker.
(2) One single queue but two workers. One worker for each job.
2 つのアプローチの違いと、どちらを採用するのがより良いアプローチかを知りたいと思います。