Preferences

RangerScience parent
I think your question is well-asked, and I lament any work environments that have led you to think asking a question like this would be A Problem(tm).

IMO - there’s a lot of things that queues are an excellent answer to. Potentially including performance.

But - queues (generally and among other things) solve the problem of “this will take some time AND the user doesn’t need an immediate response.”

If that’s not your problem, then using queues might not be the solution. If it’s something that’s taking too long and the user DOES need a response, then (as you say) optimizing is what you should try, not queues. Or some product redesign so the user either doesn’t need an immediate response. Or finding a way to split up the part producing an immediate response and the part that takes awhile.

For example: validating uploaded bulk data is in the right “shape”, and then enqueuing the full validation and insertion.

Also really really avoid jobs that enqueue jobs. Sometimes they’re necessary (spacing out some operation on chunks of a group; or a job that ONLY spawns other jobs) but mostly they’re a route to spaghetti.


This item has no comments currently.