1. A method for allocating a set of one or more processing components of an application to a set of one or more resource groups, comprising the steps performed by a computer system of: ordering the set of one or more resource groups based on respective failure measures and resource capacities associated with the one or more resource groups; assigning an importance value to each of the one or more components, wherein the importance value is associated with an effect of the one or more components on an output of the application; and assigning the one or more components to the one or more resource groups based on the importance value of each of the one or more components and the respective failure measures and resource capacities associated with the one or more resource groups, wherein the one or more components with higher importance values are assigned to resource groups with lower failure measures and higher resource capacities; wherein an order for assigning the one or more components is determined based on a data flow graph associated with the application such that a single resource group failure affects the minimal number of paths from a source to a sink in the data flow graph.