By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
(For AWS Solutions Architect – Associate)
You’re a cloud engineer at a global SaaS company. Your app runs in us-east-1, but users in Tokyo, Sydney, and Frankfurt complain about high latency and jitter—especially during peak hours. Your boss asks:
"Should we use CloudFront or Global Accelerator to fix this? And what’s the difference?"
Here’s the reality:- CloudFront = Content Delivery Network (CDN). It caches static/dynamic content at edge locations to reduce latency for read-heavy workloads (e.g., websites, APIs, video streaming).- Global Accelerator = Network Traffic Optimizer. It routes user traffic over AWS’s private backbone to the nearest healthy endpoint, reducing TCP/UDP latency for non-cacheable, real-time traffic (e.g., gaming, VoIP, financial trading, APIs with dynamic responses).
Why this matters in production:- Wrong choice = Poor performance + wasted money. - Use CloudFront for cacheable content (e.g., images, JS, CSS, API responses that don’t change often). - Use Global Accelerator for low-latency, non-cacheable traffic (e.g., WebSockets, gaming, database queries, real-time bidding).- Ignoring this = Users in Asia see 300ms+ latency while your app sits in Virginia.- Misconfiguring this = Security risks (e.g., exposing origins directly) or cost spikes (e.g., CloudFront caching dynamic data that shouldn’t be cached).
Your mission:Deploy both in a real-world scenario (e.g., a global API with static docs + dynamic endpoints) and prove which is better for each use case.
aws --version
You have: - A static website (S3 + CloudFront).- A dynamic API (ALB + ECS in us-east-1).- Users in Tokyo, Sydney, and Frankfurt complaining about slow API responses.
Your task:1. Deploy CloudFront for the static website.2. Deploy Global Accelerator for the dynamic API.3. Compare latency before/after.
aws s3api create-bucket --bucket my-global-static-site --region us-east-1 aws s3 website s3://my-global-static-site --index-document index.html --error-document error.html echo "<h1>Hello from CloudFront!</h1>" > index.html aws s3 cp index.html s3://my-global-static-site/
aws cloudfront create-distribution \ --origin-domain-name my-global-static-site.s3-website-us-east-1.amazonaws.com \ --default-root-object index.html
⚠️ Note the Distribution ID (e.g., E1A2B3C4D5E6F7).
Distribution ID
E1A2B3C4D5E6F7
aws cloudfront get-distribution --id E1A2B3C4D5E6F7 | grep "Status"
Expected output:"Status": "Deployed"
"Status": "Deployed"
curl -I https://d1a2b3c4d5e6f7.cloudfront.net
Expected output:HTTP/2 200 (fast response, cached at edge).
HTTP/2 200
aws globalaccelerator create-accelerator \ --name my-api-accelerator \ --ip-address-type IPV4 \ --enabled
⚠️ Note the Accelerator ARN (e.g., arn:aws:globalaccelerator::123456789012:accelerator/abc123).
Accelerator ARN
arn:aws:globalaccelerator::123456789012:accelerator/abc123
aws globalaccelerator create-listener \ --accelerator-arn arn:aws:globalaccelerator::123456789012:accelerator/abc123 \ --protocol TCP \ --port-ranges FromPort=80,ToPort=80
⚠️ Note the Listener ARN.
Listener ARN
aws globalaccelerator create-endpoint-group \ --listener-arn <LISTENER_ARN> \ --endpoint-group-region us-east-1 \ --traffic-dial-percentage 100 \ --health-check-port 80 \ --health-check-path /health \ --health-check-interval-seconds 30 \ --endpoint-configurations EndpointId=<ALB_ARN>,Weight=128,ClientIPPreservationEnabled=true
⚠️ Replace <ALB_ARN> with your ALB’s ARN.
<ALB_ARN>
aws globalaccelerator describe-accelerator --accelerator-arn <ACCELERATOR_ARN> | grep "DNSName"
Expected output:"DNSName": "abc123.awsglobalaccelerator.com"
"DNSName": "abc123.awsglobalaccelerator.com"
curl -I http://abc123.awsglobalaccelerator.com
Expected output:HTTP/1.1 200 OK (fast response, routed over AWS backbone).
HTTP/1.1 200 OK
curl -o /dev/null -s -w "Latency: %{time_total}s\n" http://<ALB_DNS_NAME>
Example output:Latency: 0.350s (from Tokyo to us-east-1).
Latency: 0.350s
curl -o /dev/null -s -w "Latency: %{time_total}s\n" http://abc123.awsglobalaccelerator.com
Example output:Latency: 0.120s (50-70% faster, routed over AWS backbone).
Latency: 0.120s
CacheHitRatio
BytesIn
BytesOut
Environment=Prod
Team=Backend
HealthyEndpoints
4xxErrorRate
5xxErrorRate
NewFlowCount
UnhealthyEndpoints
DefaultTTL=86400
/health
Redirect to HTTPS
Trap: CloudFront is for cacheable content.
"How do you cache static assets globally while keeping dynamic API responses fast?"
Trap: Using only CloudFront (API latency remains high).
"Which service provides automatic failover for TCP traffic?"
You have a global API (ALB in us-east-1) and a static website (S3). Users in Tokyo report: - Static site loads fast (CloudFront).- API responses are slow (300ms+).
Your task:- Reduce API latency for Tokyo users without caching.- Verify the fix with curl.
curl
# 1. Deploy Global Accelerator (if not already done) aws globalaccelerator create-accelerator --name tokyo-api-accel --ip-address-type IPV4 --enabled # 2. Add ALB as an endpoint aws globalaccelerator create-endpoint-group \ --listener-arn <LISTENER_ARN> \ --endpoint-group-region us-east-1 \ --traffic-dial-percentage 100 \ --health-check-port 80 \ --health-check-path /health \ --endpoint-configurations EndpointId=<ALB_ARN>,Weight=128 # 3. Test latency from Tokyo (use a VPN or ask a friend) curl -o /dev/null -s -w "Latency: %{time_total}s\n" http://<GLOBAL_ACCELERATOR_DNS>
Expected output:Latency: 0.120s (vs. 0.350s before).
Why it works:- Global Accelerator routes traffic over AWS’s private network, avoiding public internet congestion.
DefaultTTL
aws cloudfront create-invalidation --distribution-id <ID> --paths "/*"
Now go deploy this in your AWS account and see the difference! ?
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.