Keep Traffic within One Availability Zone and use EC2 Placement Groups - Real-Time Communication on AWS

Keep Traffic within One Availability Zone and use EC2 Placement Groups

Also known as Availability Zone Affinity, this best practice also applies to the rare event of a complete Availability Zone failure. It is recommended that you eliminate any cross-AZ traffic such that any SIP or RTP traffic that enters one Availability Zone should remain in that Availability Zone until it exits the Region.

Figure 13: Availability Zone Affinity (at most, 50% of active calls are lost)

Figure 13 shows a simplified architecture that uses Availability Zone Affinity. The comparative advantage of this approach becomes clear if one accounts for the effects of a complete Availability Zone outage. As depicted in the diagram, if Availability Zone #2 is lost, 50% of active calls are affected at most (assuming equal load balancing between Availability Zones). Had Availability Zone Affinity not been implemented, some calls would flow between Availability Zones in one Region and a failure would most likely affect more than 50% of active calls.

Furthermore, to minimize latency for traffic, we also recommend that you consider using EC2 placement groups within each Availability Zone. Instances launched within the same EC2 placement group have higher bandwidth and reduced latency as EC2 ensures network proximity of these instances relative to each other.