CloudFront & AWS Global Accelerator Flashcards

1
Q

What is CloudFront?

A

It is a CDN - Content Delivery Network

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

CloudFront (CDN) benefits

A

Improves read performance, content is cached at the edge

Improves user experience

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What form of protection does CloudFront have?

A

Against DDoS (because world wide)

Integration with Shield, AWS Web Application Firewall

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is CloudFront Origins for S3?

A

Distributing files and caching them at the edge

Enhanced Security with CloudFront Origin Access Control

CloudFront can be used as an Ingress (upload files to S3)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is CloudFront Custom origin (HTTP)

A

You can have the benefits of CloudFront Origins for services that use HTTP (caching distributed files at edge)

ALB
EC2 instance
S3 website (static website)
Any HTTP backend you want

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

CloudFront High Level (architecture)

A

Client sends GET /beach.jpg to CloudFront Edge Location.

IF it is NOT cached, then it forwards the request to the Origin (which has S3 or HTTP).

Then it Adds the requested objects from the Origin location into the Local Cache for the next time it gets requested.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Example for S3 as an Origin

A

Users will get data from the public internet at the Edge location. The Edge location would have gotten that data from the Origin (S3 bucket) which is also protected by Origin Access Control + S3 bucket policy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

CloudFront vs S3 Cross Region Replication

A

CloudFront
global edge network
files are cached for a TTL (maybe a day)
Great for static content that must be available everywhere

S3 Cross Region Replication
Must be setup for each region you want replication to happen
files updated in near real-time
read only
great for dynamic content that needs to be available at low-latency in few regions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

CloudFront ALB as an Origin

A

Users make requests to edge location public IP. Then edge location makes the request to the ALB which must be public and its sec group must allow edge location IPs.

Then the ALB will send the requests to the EC2 Instances which can be private, and their SG must allow access to the ALB’s Security Group

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

CloudFront EC2 as an Origin

A

Users send requests to edge location, then edge location sends request to the Security Group of the EC2 instances which must be public. The SG must allow the public IP of edge location

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

CloudFront GeoRestriction

A

Allowlist - define list of approved countries

Blocklist - define list of banned countries

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Use case for CloudFront GeoRestriction

A

Country is determined using 3rd party Geo-IP database.

Use cases are copyright laws to control access to content

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

CloudFront Pricing

A

Cost is lower the higher the transfer data size/amount is.

Price also depends on location

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How many price classes does CloudFront have?

A

3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Price Class All (cloudfront)

A

All regions - best performance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Price Class 200

A

most regions, but excludes the most expensive ones

17
Q

Price Class 100

A

least expensive regions only

18
Q

CloudFront - Cache Invalidation

A

Force an entire or partial cache refresh (bypassing TTL) by performing CloudFront Invalidation

19
Q

When would you use CloudFront Invalidation?

A

When you update backend origin, and CloudFront doesn’t know about it. And it will only get the refreshed content after the TTL expires

20
Q

How can you invalidate files or paths?

A
  • for all files
    /images/* for special path
21
Q

CloudFront Cache Invalidation architecture (scenario)

A

You have CloudFront with 2 Edge locations (including index.html and /images/ in their cache) and your origin S3 bucket.

You update files in S3 origin bucket.
Then you invalidate /index.html & /images/* which basically removes them from the cache.

Then a user will send a request GET /index.html to CloudFront, then it will be forwarded to the Edge location. Edge Location will realise that the cache is empty, and so it will pull the data from the S3 bucket.

22
Q

Unicast IP

A

One server holds one IP address

23
Q

Anycast IP

A

All servers hold the same IP address and the client is routed to the nearest one

24
Q

How does Global Accelerator work?

A

Uses AWS internal network to route to your application.

2 Anycast IP are created for your application.

The anycast IP sends traffic directly to Edge Locations, and the edge locations send the traffic to your ALB which then sends it to your application.

25
Q

What happens without a Global Accelerator?

A

You hop many IPs creating latency and instability by the time you reach the application.

With the global accelerator, you jump to the nearest Edge Location and from there you jump directly to the public ALB or application using the internal AWS network

26
Q

What does Global Accelerator work with?

A

Elastic IP
EC2 instances
ALB
NLB
Public or private

27
Q

Why does Global Accelerator have consistent performance?

A

Intelligent routing to lowest latency and fast regional failover
no issues with client cache (IP doesnt change)
Internal AWS network

28
Q

Does Global Accelerator offer Health Checks for apps?

A

Yes
Helps make your app global (failover less than 1 minute for unhealthy)
Great for Disaster Recovery (because of health checks)

29
Q

What security measures does Global Accelerator have?

A

only 2 external IP need to be whitelisted
DDoS protection thanks to AWS Shield

30
Q

AWS Global Accelerator vs CloudFront

A

Both use AWS global network and edge locations
Both integrate with AWS Shield for DDoS protection

31
Q

When do you use CloudFront

A

improve performance for cacheable content (images videos
Dynamic content (API acceleration and dynamic site delivery)
Content is served at the edge (hopefully always)

32
Q

When do you use Global Accelerator

A

improve performance for a wide range of apps over TCP or UDP
Proxying packets at the edge to apps running in one or more AWS regions
Good fit for non-HTTP use cases, such as gaming (UDP), IOT (MQTT) or VoIP
Good for HTTP use cases that require static IP addresses
Good for HTTP use cases that require deterministic, fast regional failover