Given we have several services which fetch data from different sources and store it in some predefined format. May be they store the fetched data in some database, or in a file or somewhere else. The idea is that all that services are very similair but they are using different sources.
Before these services were separated into several Java applications.
Now we want to unite these services in one application to share the source code and make it simplier.
A question is: how can we guarantee that one service's failure will never affect another one?
I see several possible ways:
run all tasks in separate threads. do not share some common resource that can be locked by one task. cons: memory issues are not mitigated.
run all tasks in separate JVMs. all risks are mitigated but its more complicated and requires more configuration of the host.
run all tasks on different nodes of the cluster. the most reliable way but the most resource and programmers time consuming.
Any more ideas and suggestions?