1. A non-transitory computer readable medium comprising instructions which, when executed by one or more hardware processors, causes performance of operations comprising: identifying pairs of resources from a plurality of resources, each pair of resources comprising two resources in different failure domains of a plurality of failure domains; identifying a plurality of resource consumers, wherein each resource consumer of the plurality of resource consumers is associated with (a) a primary instance and (b) a backup instance; specifying a set of one or more constraints that limit assignment of the plurality of resource consumers to the plurality of resources to: assigning the plurality of resource consumers respectively to the pairs of resources; and creating a data model, applicable to a constraint programming solver, comprising: a first plurality of data model elements corresponding respectively to the pairs of resources; a second plurality of data model elements corresponding respectively to the plurality of resource consumers; and the set of constraints.