AWS My Notes With Examples
AWS My Notes With Examples
1. Autobalancing:
Let's say you have a computer with 4 cores, and you want to run 4 different tasks (programs).
Instead of all tasks running on one core, the system can "autobalance" and distribute these
tasks across all 4 cores to ensure that none of the cores is overloaded. Each core runs one
task, preventing slowdowns due to an overworked core.
Imagine you and three friends are assigned 12 tasks. Without autobalancing, one person
might end up with 8 tasks, while others only get 1 task each. With autobalancing, tasks are
evenly distributed so each person gets 3 tasks to ensure everyone shares the workload
equally.
2. Load Balancer:
A load balancer is a tool or a service that helps distribute incoming traffic (or tasks) across
multiple servers. This ensures that no single server gets overwhelmed and that the system
remains efficient and responsive.
Consider a website like an online store. If 10,000 users visit the site at the same time, a single
server might slow down or crash due to too much traffic. A load balancer sits between the
users and the servers and distributes the traffic across multiple servers. For example:
This distribution ensures that no single server becomes overwhelmed, and users experience
faster page loads.
Imagine a restaurant with three waiters (representing servers). A "host" (acting as the load
balancer) stands at the door. As customers (incoming tasks) arrive, the host distributes them
to the waiters evenly so that no one waiter is overloaded with too many customers, ensuring
efficient service for everyone.
In short:
Both concepts aim to optimize system performance and ensure that resources are efficiently
utilized.
HTTP is the protocol used for transferring data (like text, images, videos) between your
browser and a web server. It's how websites communicate with your device.
Example: When you type a website URL like http://example.com in your browser, your
device uses HTTP to request the webpage from the server. The server then sends the
webpage back to your browser.
However, HTTP is not secure — the data sent between your browser and the server can be
intercepted and read by others.
HTTPS is a secure version of HTTP. It encrypts the data exchanged between your browser
and the server, making it much harder for others to read or tamper with it.
Example: When you visit a website like https://example.com, your browser establishes a
secure connection with the server. All the information, such as passwords or credit
card details, is encrypted and safe from eavesdroppers.
You can recognize an HTTPS site by the padlock icon in the browser's address bar.
TCP is a protocol that ensures reliable and accurate delivery of data between two devices
over the internet. It breaks data into smaller packets and makes sure all packets arrive
correctly and in order.
Example: When you download a file from a website, TCP ensures the entire file is
transferred correctly, with no missing or out-of-order pieces. If some data packets are
lost, TCP resends them to ensure complete delivery.
TCP is used in applications where accuracy matters (like downloading files, emails, or web
browsing).
UDP is a protocol used for fast, but less reliable, data transmission. Unlike TCP, it doesn't
check if all packets arrived or if they arrived in the right order. This makes UDP faster but
less reliable than TCP.
Example: Streaming a live video or playing an online game. In these cases, speed is
more important than perfect accuracy. Some data packets might get lost, but you
won’t notice because the stream or game continues without waiting for missing data.
UDP is ideal for real-time applications where small delays are acceptable, but speed is
critical.
Summary:
4o
An Application Load Balancer (ALB) and a Network Load Balancer (NLB) are two types
of load balancers that distribute incoming traffic across multiple servers to ensure no single
server is overwhelmed. Here’s a simple breakdown with examples:
Summary:
ALB: Best for web applications where you need to route traffic based on content
(URL, headers, etc.).
NLB: Best for high-performance apps where speed and simplicity are crucial, and
traffic is distributed based on IPs and ports.
1. Isolation:
o A VPC gives you control over a private section of the cloud where your
resources (servers, databases) are kept separate from others' resources. Think
of it like renting your own office space within a large building. Even though
you're in the same building as others, you have your own private area.
2. Subnets:
o Inside your VPC, you can create subnets, which are smaller network
segments. Each subnet can be used for different parts of your application. For
example, you might want a public subnet for web servers that the internet can
access and a private subnet for databases that only your web servers can
access (not the internet directly).
Example:
o Public subnet: A web server that's accessible to users visiting your website.
o Private subnet: A database that's only accessible to the web server, not directly
to users.
3. IP Addressing:
o You assign IP addresses to your resources in the VPC, just like in a
traditional data center. These addresses are either public (internet-facing) or
private (internal only). Private IP addresses are used for communication
between resources inside the VPC, while public IPs allow external access.
Example:
o A database might use a private IP address because it only needs to talk to your
web server, not the internet.
4. Routing:
o You use routing tables to control how traffic moves within your VPC. For
example, you might set a rule that says all internet-bound traffic from your
web servers should go to a specific internet gateway (a doorway to the
internet), while traffic between subnets should stay private.
Example:
o When a user types in your website address, the request is routed from the
public internet, through the VPC’s internet gateway, and to your web server.
5. Security Groups & Network ACLs:
o Security groups are like firewalls for your VPC. They control which types of
traffic are allowed to enter or leave your resources (such as a virtual machine
or database).
o Network ACLs (Access Control Lists) work similarly but apply at the subnet
level, adding an additional layer of security.
Example:
o Security group: You can allow only HTTP (port 80) traffic to your web server
and block everything else.
o Network ACL: You can block all traffic from a specific IP address range (e.g.,
if you think those addresses are malicious).
6. Internet Gateway (IGW):
o An Internet Gateway allows your VPC to connect to the public internet. If
you have resources like a web server that need to be accessed by users on the
internet, you'll route their traffic through the internet gateway.
Example:
o Your web server, which is in the public subnet, uses the internet gateway to
receive user requests from the internet.
7. NAT Gateway:
o A NAT (Network Address Translation) Gateway allows resources in a
private subnet (such as a database) to access the internet for things like
software updates but prevents the internet from initiating a connection with
those resources.
Example:
o Your database can download security patches from the internet but remains
invisible to anyone trying to reach it from outside the VPC.
1. Create a VPC: You create a VPC for your application in a cloud provider like AWS.
2. Subnets:
o You create two subnets:
Public subnet: for the web server.
Private subnet: for the database.
3. Security Groups:
o Web server security group: Allow HTTP and HTTPS traffic from the internet.
o Database security group: Only allow traffic from the web server in the private
subnet.
4. Routing:
o Set up routing so traffic to the web server goes through the internet gateway,
and traffic between the web server and the database stays within the VPC.
5. NAT Gateway:
o If your database needs to access the internet (e.g., to download updates), you
set up a NAT gateway in the public subnet to handle this.
6. Internet Gateway:
o The web server uses the internet gateway to communicate with users who visit
your website.
In this way, a VPC helps you organize, secure, and control your cloud infrastructure while
maintaining the flexibility to scale and connect resources as needed.
In AWS, an Internet Gateway (IGW) is a tool that allows resources in your VPC (like
virtual machines or web servers) to connect to the internet. It acts as a doorway between your
private network in the cloud and the public internet.
For example, if you have a website hosted in AWS, the IGW helps users on the internet
access it. Similarly, it allows your cloud resources to reach the internet, such as to download
updates.
Implicit Router
In AWS, the "implicit router" refers to the default, hidden router that handles traffic within a
Virtual Private Cloud (VPC). This router is automatically available and doesn't require
manual configuration. It routes traffic between subnets in the same VPC and enables
communication between resources, like EC2 instances, inside the VPC. You don't see or
manage the router directly; instead, its behavior is governed by the VPC's route tables, which
define how traffic is directed.
In essence, the implicit router acts as the backbone for VPC networking, allowing smooth
internal communication between resources without the need for explicit setup.
Route table
In AWS, a route table is like a map that tells your network traffic where to go. It contains a
set of rules, called routes, that define how data should be directed within your VPC (Virtual
Private Cloud).
Each subnet in your VPC must be associated with a route table. The table specifies which
traffic should stay inside the VPC and which traffic can go outside, such as to the internet
through an Internet Gateway (IGW).
For example, a route table could have a rule that says, "Send all traffic for the 10.0.0.0/16
network (your VPC) internally, but send everything else to the internet via the IGW."
In short, it controls the flow of data inside your network and to the outside world.
IP Address
In AWS, an IP address is used to identify resources, like EC2 instances, within a network.
There are two main types of IP addresses in AWS:
1. Private IP Address: This is used for internal communication within your VPC.
Resources with private IPs can talk to each other inside the VPC, but they can't be
reached from the internet.
2. Public IP Address: This is assigned to resources like EC2 instances that need to be
accessible from the internet. A public IP allows people outside your VPC (on the
internet) to connect to your resource.
Example:
Private IP: A web server in a VPC can talk to a database server using their private
IPs.
Public IP: If the web server needs to be accessed by users from the internet, it will be
given a public IP address.
AWS automatically assigns private IPs when you launch an instance, and you can opt for
public IPs if needed.
S3-------> Simple Storage Service,
In AWS, S3 stands for Simple Storage Service, a service that allows users to store and
retrieve any amount of data at any time from anywhere on the web. It’s widely used because
it is scalable, durable, secure, and easy to integrate. Here’s a simple breakdown of S3
concepts:
1. Buckets:
Buckets are containers for storing your data. Every object (file) in S3 is stored in a
bucket. Each bucket has a globally unique name across AWS, and you can think of it
as a folder.
2. Objects:
Objects are the actual files or data you store in a bucket. Each object consists of data,
metadata (information about the file), and a unique identifier (key). Objects can be
any type of file like images, videos, documents, etc.
3. Keys:
A key is the unique identifier for an object within a bucket. Every object in an S3
bucket has a key, which is its name in that bucket, similar to a file name in a folder.
4. Storage Classes:
S3 offers different storage classes based on how often you access your data:
o Standard: Used for frequently accessed data.
o Intelligent-Tiering: Automatically moves data to the most cost-effective
storage based on usage.
o Glacier: For long-term, archival storage that is rarely accessed but needed for
compliance.
o Others like One Zone-IA for less critical, infrequent access data.
5. Versioning:
6. Access Control:
You can control who has access to your data in S3. This can be done using:
o Bucket Policies: These are rules that define who can access your bucket and
its contents.
o Access Control Lists (ACLs): Define permissions for individual objects or
buckets.
7. Data Encryption:
S3 offers encryption to protect your data, both at rest and in transit. You can use
server-side encryption (AWS manages the encryption keys) or client-side encryption
(you manage the encryption).
8. Lifecycle Policies:
These allow you to automatically move objects to different storage classes or delete
them after a certain period. For example, you can move infrequently accessed files to
cheaper storage after 30 days.
This feature lets you automatically replicate your data from one S3 bucket to another
in a different AWS region. It’s useful for disaster recovery or if you need to keep data
close to your users in multiple regions.
This feature speeds up the transfer of files to and from S3 over long distances by
using optimized AWS network paths.
Scalability: S3 can handle massive amounts of data without requiring you to manage
infrastructure.
Durability: S3 provides 99.999999999% durability, meaning your data is safe and
reliable.
Availability: S3 ensures high availability of your data, meaning it’s almost always
accessible.
Cost-effective: You only pay for what you use, and you can use cheaper storage
classes for data you don’t access often.
In short, AWS S3 is a highly flexible and scalable cloud storage service that supports various
use cases, from simple file storage to large-scale data backups and disaster recovery.