UptimeUptime Wiki

Anti-affinity placement

Anti-affinity is the rule that says "don't put both copies of the same thing on the same host, or in the same hall." It is what makes a two-copy contract actually mean something. Without it, the allocator could cheerfully pack both replicas onto the same machine — and then a single failure takes out both copies at once, exactly the outcome the customer paid to avoid.

When a customer buys Replicated or Multi-AZ, anti-affinity is the promise behind it: copies land on different hosts (or different halls), so no single failure can hit them all. It is the difference between redundancy you can sell and redundancy that only looks good on paper.

Detailed explanation

The placement constraint

Anti-affinity is a placement constraint: replicas must land on distinct host ids (Replicated tier) or distinct AZ ids (MultiAz tier). The allocator rejects any placement that would violate the constraint rather than silently co-locating copies.

When it can't be satisfied

If no compatible host exists that honours the constraint, the placement does not fall back to co-location — it falls back to eviction or a pending state. That is deliberate: a violated anti-affinity rule is worse than a delayed placement, because it quietly converts a redundant customer into a single-point-of-failure one.

On this page