AWS CloudFront and Global Accelerator: Which is Right for Your Business?

2023.02.07

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

Amazon Web Services (AWS) offers two popular content delivery services: AWS Global Accelerator and Amazon CloudFront. Both services are designed to help improve the performance and availability of web applications, but they approach the problem in different ways.AWS Global Accelerator is designed to improve the performance of web applications by directing user traffic to the optimal AWS Region for their location. This is accomplished by using Anycast IP addresses, which route traffic to the closest AWS Region that has the lowest network latency. Global Accelerator provides a single entry point for internet traffic, which can improve the performance of web applications that are deployed across multiple AWS Regions.

Amazon CloudFront, on the other hand, is a content delivery network (CDN) service that speeds up the delivery of static and dynamic web content, such as images, videos, and APIs. CloudFront achieves this by caching content in edge locations around the world and serving it from the location closest to the end user. This reduces the distance that data needs to travel, which improves performance and reduces latency.

Use cases

AWS Global Accelerator and CloudFront can be used in a variety of use cases to improve the performance and availability of web applications and services. Here are some examples:

  1. Global Content Delivery: If you have a web application that serves content to users worldwide, you can use CloudFront to distribute the content from edge locations closer to the user. Global Accelerator can then be used to route traffic to the closest CloudFront edge location, providing fast and reliable delivery of your content.
  2. Multi-Region Deployments: If you have a web application deployed in multiple AWS Regions, you can use Global Accelerator to route traffic to the closest Region, improving performance for users. CloudFront can also be used to cache content at edge locations for faster delivery to users.
  3. Hybrid Deployments: If you have a web application that is deployed both on-premises and in the cloud, you can use Global Accelerator to route traffic to the appropriate environment based on network performance, availability, and other factors.
  4. Dynamic Content Delivery: If you have a web application that serves dynamic content that changes frequently, you can use CloudFront to cache the content at edge locations for faster delivery to users. Global Accelerator can then be used to route traffic to the appropriate origin server based on the availability of the content.

These are just a few examples of how AWS Global Accelerator and CloudFront can be used in different use cases. The specific solution that is right for your web application will depend on a variety of factors, including your performance and availability requirements, the type of content you are serving, and the deployment architecture of your web application.

Architecture Difference

AWS Global Accelerator and CloudFront are two different services with different architectures and purposes.

Global Accelerator is a network service that routes traffic to the closest AWS Region for a user's location, improving performance for users by reducing network latency and reducing the number of hops that traffic has to take across the internet. Global Accelerator uses Anycast routing, which directs traffic to the closest available endpoint.

CloudFront, on the other hand, is a content delivery network (CDN) that speeds up the delivery of static and dynamic web content, such as HTML pages, images, videos, and APIs. CloudFront caches content at edge locations around the world, allowing users to access content from the edge location closest to them, reducing the amount of time it takes for the content to reach the user.

Edge Computing

Amazon's CloudFront allows you to cache your content at edge locations by following specific patterns you specify, such as file types, headers, and URLs. By caching and compressing your content at these locations, you can significantly reduce latency and offload traffic from your backend systems, resulting in greater scalability for your applications.

However, if your backend only delivers dynamic content or uses non-TCP protocols, Global Accelerator may be the better choice. Unlike CloudFront, Global Accelerator doesn't cache content. Instead, it leverages edge computing to determine the quickest route to the next regional endpoint, making it a great solution for gaming and IoT and helping to avoid endpoint failure.

Pricing

CloudFront

The cost of using CloudFront is determined by the amount of data transmitted over the internet and the number of requests made to a CloudFront distribution. Transfers of Amazon EC2 or S3 resources to CloudFront are free of charge. The rate of data transfer may vary depending on the region in which the edge location is located and can fluctuate by as much as 40%.

Data transfer pricing is bracketed based on the monthly amount transferred. CloudFront also offers a Security Savings Bundle that, with a one-year commitment, can reduce costs by 30%. Global Accelerator does not have a similar savings bundle.

Another valuable aspect of CloudFront is its Lambda@Edge feature, which allows for the optional triggering of Lambda functions for incoming requests and outgoing responses. This gives application owners the ability to add additional functionality, such as validations, data transformations, or custom logic, based on incoming or outgoing data. Global Accelerator does not offer a similar feature.

Global Accelerator

The cost of using AWS Global Accelerator is based on two main factors: an hourly fee and a data transfer fee. The hourly fee is currently $0.025 per hour, which equates to roughly $18 per month.

Data transfer fees can vary greatly based on the data origin, destination, AWS Region, and edge location. They can range from $0.015 GB to $0.105 GB and are calculated based on the predominant direction of traffic during each hour. For instance, if 50% of the data transfer is incoming data sent to backend systems and 50% is outbound data, only the incoming data is used to calculate data transfer fees during that hour.

It's important to note that the pricing of data transfer fees is subject to change and can be affected by a variety of factors. I would recommend visiting the AWS Global Accelerator pricing page (https://aws.amazon.com/global-accelerator/pricing/) for the most up-to-date information on data transfer fees and other associated costs.

Summary

In summary, Global Accelerator is designed to improve the performance of applications by routing traffic to the closest available AWS Region, while CloudFront is designed to improve the delivery of content by caching it at edge locations around the world. The specific solution that is right for your application will depend on your performance and availability requirements, the type of content you are serving, and the deployment architecture of your web application.