Help Center> ServiceStage> FAQ> Application Management> What Are Affinity and Anti-affinity?

What Are Affinity and Anti-affinity?

Before an application is containerized, multiple components are installed on a VM and processes communicate with each other.

During container splitting, containers are split by process. For example, service processes are stored in a container, and monitoring logs or local data is saved in another container. The two containers have an independent lifecycle. If the two containers are distributed far away from each other on the network, the request is forwarded at multiple times and the performance may deteriorate.

  • Affinity means proximity deployment, which strengthens nearest routing for network communication and reduces network loss.
  • Anti-affinity indicates that instances are scattered as possible for the sake of high reliability. When a node is faulty, only 1/n applications or one instance is affected.