#Multiple workers vs 1 worker with routes

4 messages · Page 1 of 1 (latest)

hybrid bison
#

Complete beginner question, but is there an advantage to using multiple workers as opposed to just one worker with routes (using something like itty router)?

When does it make sense to use one use case over the other?

granite veldt
#

I also had the same dilemma. Eventually, I just figured out that if exceed the 1MB upload limit. I have to split the routes into multiple workers, otherwise, a single worker works fine.

gray lodge
#

At a certain size it can make sense to split for maintainability. The micro-frontend architecture follows this kind of mentality: https://blog.cloudflare.com/better-micro-frontends/

My personal recommendation would be to stick with a single worker and something like itty-router or Hono until you find a need to create multiple.

obsidian pulsar
#

I've wrestled with the same dilemma. I decided to split into different workers where the functions are very different. I don't want to break functionality A when deploying functionality in B.