BACKGROUND
I am trying to design a micro-services based SaaS application, where each micro-service would be packaged into their specific Docker container.
I also have a CLI tool (a binary file) that functions as a Swiss knife (i.e. does more than one thing) and there are a few micro-services that would want to use the tool's various functionality, making the tool important in the whole architecture. The tool can consume/produce a file or a stream.
PROBLEM
I am unable to decide between the following:
- Should I package the tool as part of each micro-service that needs it?
- Should I package the tool as a separate service itself?
How does one decide between the two? Are there any other alternatives?
CAVEAT
Each micro-service may need to spawn/access multiple instances of the tool at the same time. To elaborate further, the micro-service can use the tool multiple times, in sequence or in parallel to generate different outputs, which, later are aggregated and passed onto other services.