Skip to main content

Introduction To Amazon Web Services

· 10 min read
Ilham Surya
SRE Engineer - Fullstack Enthusiast - Go, Python, React, Typescript

alt text

This post will cover introduction about cloud feature especially on amazon web services, what is it use case, benefit and comparison with other cloud provider

EC2 Instances

What Is EC2?

EC2 well known as Amazon compute services is web service that provide secure, reliable compute capacity in cloud. This things Similar with container used to provide the web services. There is also multiple type of each compute with different spesification. but one thing certain is all of this has it own pattern

alt text

As mention in the image. it break down the naming convention of an Amazon Elastic Compute Cloud (EC2) instance type

  1. c5: Represents the instance family. The "c" indicates that this instance type is optimized for compute-intensive workloads. The "5" indicates the instance generation. This means it's the fifth generation of C-type instances, benefiting from newer hardware and generally better performance and price-to-performance ratios compared to older generations.

  2. n: This is the instance attribute. The "n" signifies that this instance type has enhanced networking capabilities. This typically means higher network bandwidth and lower latency, making it suitable for network-intensive applications.

  3. xlarge: This denotes the instance size. It refers to the amount of vCPU and memory allocated to the instance. "xlarge" represents a specific configuration (in this case, 4 vCPUs and 8 GiB of memory). Other sizes within the c5n family could include "large," "2xlarge," "4xlarge," etc., each offering different resource allocations.

EC2 Type Description

First Letter (Instance Family):

C – Compute: Optimized for compute-intensive tasks, offering a balance of CPU, memory, and networking. Good for web servers, application servers, and CI/CD.
D – Dense Storage: Designed for applications requiring high sequential read and write access to data. Suitable for data warehousing, big data processing, and log processing.
F – FPGA: Equipped with Field Programmable Gate Arrays (FPGAs) for hardware acceleration of custom algorithms. Ideal for specific workloads like financial modeling, genomics research, and video processing.
G – GPU: Features GPUs for graphics-intensive applications like gaming, video rendering, machine learning, and high-performance computing (HPC).
Hpc – High Performance Computing: Specifically designed for HPC workloads, providing high-performance networking and compute capabilities. Used for scientific simulations, financial modeling, and other computationally demanding tasks.
I – I/O: Optimized for high I/O performance, offering very high random I/O operations per second (IOPS). Best for NoSQL databases, transactional databases, and other I/O-intensive workloads.
Inf – AWS Inferentia: Powered by AWS Inferentia chips, designed for machine learning inference workloads. Offers high performance and cost-effectiveness for deploying trained ML models.
M – Most scenarios: A general-purpose instance type suitable for a wide variety of applications. Provides a balance of compute, memory, and network resources.
P – GPU: Another GPU-based instance family, similar to G, but often with more powerful GPUs for even more demanding graphics-intensive workloads.
R – Random Access Memory: Optimized for memory-intensive applications, offering large amounts of RAM. Good for in-memory databases, caching, and real-time big data analytics.
T – Turbo: Burstable performance instances, ideal for workloads with occasional spikes in demand. Provides baseline CPU performance with the ability to burst to higher levels when needed.
Trn – AWS Trainium: Powered by AWS Trainium chips, specialized for deep learning training workloads.
U – Ultra-High Memory: Designed for applications requiring massive amounts of memory.
VT – Video Transcoding: Optimized for video transcoding and processing workloads.
X – Extra-Large Memory: Offers a large amount of memory relative to CPU cores, suitable for memory-bound applications.
Suffixes (Instance Attributes and Size):
a – AMD processors: Indicates that the instance uses AMD processors.
g – AWS Graviton processors: Indicates that the instance uses AWS Graviton processors (ARM-based).
i – Intel processors: Indicates that the instance uses Intel processors.
d – Instance store volumes: Includes instance store for temporary storage.
n – Network and EBS optimized: Enhanced networking performance and optimized for Amazon Elastic Block Storage (EBS).
e – Extra storage or memory: Provides additional storage or memory compared to the base instance size.
z – High performance: Offers high CPU clock speeds and sustained all-core turbo performance.

Instance Size: (nano, micro, small, medium, large, xlarge, 2xlarge, 4xlarge, 8xlarge, 12xlarge, 16xlarge, 24xlarge, 32xlarge, metal) Indicates the vCPU and memory configuration. Larger sizes provide more resources.

VPC

A VPC is a virtual network that we can create in the cloud. It allows us to have own private section of the internet, Within this VPC, we can create and manage various resources, such as servers, databases, and storage. and also Just like a physical network, a VPC has its own set of rules and configurations. We can define the IP address range for your VPC and create smaller subnetworks within it called subnets. These subnets help us organize the resources and control how they communicate with each other.

alt text

VPC Component

This diagram illustrates how an Internet Gateway (IGW) connects a Virtual Private Cloud (VPC) to the internet in AWS. Let's break it down:

  1. Region: The largest geographical container in AWS. A region comprises multiple Availability Zones.

  2. VPC (Virtual Private Cloud): A logically isolated section of the AWS cloud. We define the IP address range, create subnets, and configure route tables within your VPC.

  3. Availability Zone (AZ): Distinct locations within a region that are engineered to be isolated from failures in other AZs. They provide redundancy and fault tolerance.

  4. Subnet: A subdivision of a VPC. We can have multiple subnets within a VPC, each in a different Availability Zone. Subnets are used to organize and control network traffic within your VPC.

  5. Instances: These are our EC2 instances (virtual servers) running within the subnets.

  6. Internet Gateway (IGW): The key component enabling communication between your VPC and the internet. It acts as a two-way gateway for traffic flowing between your instances and the internet.

VPC How It Works

  1. Inbound traffic: When traffic from the internet is destined for an instance in the VPC, it enters through the IGW. The IGW routes the traffic to the correct subnet and instance based on the routing tables configured in your VPC.
  2. Outbound traffic: When instances within the VPC need to access the internet, the traffic flows through the IGW to the internet.

VPC with server in private subnets and NAT

alt text

This diagram slight more complex than the previous one. Here there is additional networking and the server inside of it. I will break down it:

Networking

  1. Public Subnets: Subnets that have a route to the internet through the Internet Gateway (implied but not shown directly). Resources in public subnets can be accessed from the internet.
  2. Private Subnets: Subnets that do not have direct access to the internet. Resources in private subnets can communicate with the internet through a NAT Gateway.
  3. NAT Gateway (Network Address Translation): Allows instances in a private subnet to connect to the internet or other AWS services, but prevents the internet from initiating a connection with those instances. This enhances security.
  4. Application Load Balancer (ALB): Distributes incoming application traffic across multiple targets, such as EC2 instances, in multiple Availability Zones. It provides high availability and fault tolerance.
  5. S3 Gateway: Connects the VPC to Amazon S3 (Simple Storage Service), a highly scalable object storage service, likely for storing static content (images, videos, etc.).

Compute

  1. Servers (EC2 Instances): Virtual machines that run the application code.
  2. Auto Scaling Group: Dynamically adjusts the number of EC2 instances based on traffic demand. This ensures that the application can handle traffic spikes and also scales down to save costs during periods of low traffic.
  3. Security Group: Acts as a virtual firewall for your EC2 instances, controlling inbound and outbound traffic based on rules you define (e.g., allowing HTTP traffic on port 80)

Data (Icon On Top)

  1. S3 (Simple Storage Service - bucket icon): Object storage, likely for static content.
  2. Database (Database icon): A database service, perhaps RDS (Relational Database Service) or DynamoDB (NoSQL database).
  3. CloudSearch or Elasticsearch (Magnifying glass on cloud icon): A search service.
  4. Shared File System (Document icon): A service like EFS (Elastic File System) providing shared file storage.
  5. Code Repository (icon): Likely CodeCommit, GitHub, or similar, for storing application code.

AWS Route 53

Route 53 is AWS's domain service. It reads the domain and forwards traffic to the appropriate destination according to the defined record. Route 53 can be weighted and distributed across multiple domain targets

Route 53 Use Case

alt text

This diagram illustrates a disaster recovery (DR) architecture for a TicTacToe game application deployed on AWS, using a multi-region active-standby configuration. Let's break it down:

Core Components

  1. TicTacToe Game Servers: These are the application servers running the game logic. They are deployed in two different AWS regions (us-east-1 and us-west-1) and across multiple Availability Zones (AZs) within each region for high availability.
  2. Global Table (Amazon DynamoDB): DynamoDB is a NoSQL database service. The "Global Table" feature allows you to replicate data across multiple regions automatically. This ensures data consistency and availability in case of a regional outage.
  3. Amazon Route 53: This is AWS's DNS service. It directs traffic to the appropriate game servers based on the current active region.
  4. tictactoe.go-aws.com: This is the domain name used to access the game.

Active-Standby Configuration

  1. Active Region (us-east-1): In normal operation, all traffic is routed to the game servers in the us-east-1 region. These servers are actively handling user requests. They read and write data to the DynamoDB Global Table in this region. The changes are replicated to the standby region's table.
  2. Standby Region (us-west-1): The game servers in the us-west-1 region are on standby. They are running but not receiving any live traffic. The DynamoDB Global Table in this region is kept synchronized with the active region's table, but it's not actively serving requests.

Disaster Recovery Process (Implied)

In case of a failure or outage in the active region (us-east-1), the following would happen (though it's not explicitly shown in the diagram):

  1. Route 53 Failover: Amazon Route 53 would detect the failure in the active region and automatically reroute traffic to the standby region (us-west-1).
  2. Standby Becomes Active: The game servers in us-west-1 would start receiving traffic and become the active region. They would read and write data to the DynamoDB Global Table in us-west-1.

AWS Bucket S3

alt text

AWS S3 Buckets are a storage service provided by Amazon Web Services (AWS). They are highly scalable and secure containers used to store and retrieve any amount of data from anywhere on the web. S3 Buckets allow us to organize data into folders and manage access permissions. They are commonly used for backup and restore, data archiving, website hosting, and distributing content. With its durability, availability, and cost-effective pricing, AWS S3 Buckets have become a popular choice for storing and managing data in the cloud.

AWS Cloudformation

alt text

CloudFormation is a native IaC AWS service designed specifically for managing AWS resources.

Cloudformation UseCase

  1. Launching Serverless Applications: Define Lambda functions, API Gateway endpoints, DynamoDB tables, and other serverless components in a CloudFormation template. Deploy and manage your serverless applications easily, scaling them automatically based on demand.

  2. Infrastructure as Code for Disaster Recovery: Define your disaster recovery infrastructure in CloudFormation templates. Quickly deploy and configure backu