I'm sorry if I'm using any wrong terminology here.
I'm trying to design an architecture where there can be big and small tasks (e.g. processing big or small images). Big tasks can only be handled by big boxes while small tasks can be handled by either big or small boxes. The big tasks can finish while there are still small tasks to run. It doesn't make sense to immediately scale down the big boxes because they take a while to boot, and we always want at least some number running. However, it would be nice if the big boxes could start processing small tasks while they wait because they cost a-lot.
- I was thinking one way could be to have a completely separate service for each then if the big tasks were done it could start consuming from the small queue. (see image below) However, this seemed troublesome with 'at least once' delivery and potentially other issues
- I thought a separate way could be to have both in the same service, and talking to the same database, but utilize the 'inbox' messaging pattern so the big box would read the other 'inbox' if there were no messages in it's default. The thing that seemed strange to me about this was that different instances in the same service would be configured differently. That's not something I've done before so it smells fishy to me.
- A third option I thought of would be to have two separate services, but both talk to the same database. Again, I've not done that before so it just smells fishy to me.
Is there a 'typical' way of handling this problem? Should I just be avoiding this all together and just forget trying to have 'big task service' process small tasks?