Understanding the AWS Global Infrastructure 🌐
Tags: aws, programming, devops, cloud
Published: 2022-08-18 17:21:00

## Introduction 🚀
AWS has many related concepts that you might use for understanding how the AWS Global Infrastructure works. You should get familiar with them, as they are important factors in your day-to-day activities on AWS. At the end of this post, you will be familiar with the following points:

— [AWS Regions](#aws-regions)
— [AWS Region Scope](#aws-region-scope)
— [AWS Global Scope](#aws-global-scope)
— [AWS Availability Zones](#aws-availability-zones)
— [Choose an AWS Region](#choose-an-aws-region)
— [Origin Servers](#origin-servers)
— [Edge Locations](#edge-locations)
— [General Edge Location](#general-edge-location)
— [Edge Locations and General Edge Locations](#edge-locations-and-general-edge-locations)

## AWS Regions 🚀
Sometimes hearing about AWS Regions is not easy to understand, but it is so simple. A region is a geographic area connected to another one where AWS has data centers, which house the infrastructure that AWS uses to work in
this location.

The AWS regions have names and codes. For example, if we select the US East (N. Virginia) region in the AWS Console, we can see its code is `us-east-1`. Also, you should keep in mind that every region is physically isolated from and independent of every other region in terms of location, power, water supply, etc.

## AWS Region Scope 🚀
The major of AWS Services are scoped to a specific region, but to understand it easily, let's check this example.

I created a MySQL database with the name `database-1` in the `us-east-1` region, you can see it in the following image:

![us-east-1-screanshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tm7eao0jl7ahpzuny8gx.png)

But if I change to another region, in this case, US East (Ohio)
`us-east-2` does not appear in my AWS Console.

![Us-west-3-screanshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g1j7noc7gjceqi3xo4xg.png)

This happened because it was created in another region. This is the region scope, each service is scoped to the region where it was created.

The problem with it is if a user in London tries to access a resource in N. Virginia, it will have more latency, but there are many ways to solve these problems. So you don't have to worry about it so far.

## AWS Global Scope 🚀
After read the previous point, we can imagine what is the global scope, a service that is available for all. AWS Service has many services that use the global scope mode, for example: AWS IAM, AWS Route53, CloudFront, AWS WAF.

![global scope](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mfzwfh5b1jpxbfuqrcxa.png)

In the above image, we can see Cloud Front in the AWS Console, all regions are unavailable except one, global region.

## AWS Availability Zones 🚀
Each region have one or more availability zones, which are used for redundancy and also for data replication. Nowadays, the rockets and aircraft have emergencies engines, if one fail there are more that avoid the aircraft fall and each engine is independent. In the same way the availability zones works, if one fail there are more working on.

![Availability zones architecture](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dx3dhfy50ayjmfdghrzu.png)

If you anytime have used AWS, sure you have seen something like `us-east-1a`, `us-east-1b`, `us-east-1c`, as you can suppose the `us-east-1` the region code but, why does it contain a, b and c?. This is the code for an availability zone inside the region.

## Choose an AWS Region 🚀
There are many reasons, the following are the main:

— **Network Latency**: A region closest to your location and your customer's location is significant to optimize the network latency.

— **Available Services**: AWS has many services that you probably want to use, or maybe AWS launched a new service, but it does not mean that it will be available in all regions. Usually, the newest services start on a few main regions, then pop up in other regions later.

— **Cost**: Yes, AWS regions are essential to estimate, the cost of the AWS resources depend on the regions where it was launched. If you want to check it out deeper, check this interesting post about [regions and costs](https://www.concurrencylabs.com/blog/choose-your-aws-region-wisely/) using the [aws-pricing-tool](https://github.com/concurrencylabs/aws-pricing-tools).

— **Compliance with legal requirements**: For example, if you need to store some user information, sometimes government wants to keep this information inside its region.

## Origin Servers 🚀
The concept of origin server is necessary to understand how the AWS Global Infrastructure works. It stores the original, definitive version of your data. For example, if you create an S3 bucket to store images, it's the origin server.

## Edge Locations 🚀
An Edge location is not part of regions, but has an important part to reduce the network latency. Edge locations are servers around the world specialized in file cache.

## General Edge Location 🚀
When the user requests the data, then data is no longer available at the edge location. Therefore, the edge location retrieves the cached data from the Regional edge cache instead of the Origin servers that have high latency.

## Edge Locations and General Edge Locations 🚀
Those are the main for AWS CloudFront, if you never have heard about it, it is so simple. CloudFront helps to deliver content stored in a region to another region with low latency, it happened thanks to edge locations and general edge locations.

## Summary
— **AWS Regions** are geographic areas connected to themselves where AWS has data centers.
— The major of **AWS Services are scoped** to the region where it was created.
— The **Availability Zones** are used for redundancy and also for data replication inside an AWS Region.
— At the moment of select and AWS Region, you must consider the **network latency** to reduce the loading time. You must check the **service availability** in the regions selected. Remember that the region impact in the **services cost** and that you accomplish with legal requirements.
— **Origins servers** are used to store the original, definitive version of your data.
— **Edge locations** are server specialized on data cache.
— **General edge locations** cache non-available data in edge locations, to reduce the network latency.