Amazon EC2 (Elastic Compute Cloud)
Amazon EC2 is a web service provided by Amazon Web Services (AWS) that offers resizable, virtual computing capacity in the cloud.
It allows users to rent virtual machines (instances) to run applications, scale computing resources up or down based on demand, and pay only for the capacity used.
EC2 instance
An EC2 instance is a virtual machine (VM) running on AWS’s physical servers, configured with a specific operating system, CPU, memory, storage, and networking capabilities based on user requirements.
Amazon EC2 Instance Types
Ways to interact with AWS services
Compute and shared responsibility
The AWS Shared Responsibility Model outlines the division of duties between the customer and AWS.
AWS handles the security of the cloud (hardware and infrastructure), whereas the customer is responsible for security in the cloud (applications, data, and access control).
AMI (Amazon Machine Images)
AMIs are pre-built virtual machine images that have the basic components for what is needed to start an instance.
AMIs provide repeatability through a consistent environment for every new instance.
AMI components
An AMI includes the operating system, storage setup, architecture type, permissions for launching, and any extra software that is already installed.
You can use one AMI to launch several EC2 instances that all have the same setup.
Three ways to use AMIs
Scalability
Scalability refers to the ability of a system to handle an increased load by adding resources.
Elasticity
Elasticity is the ability to automatically scale resources up or down in response to real-time demand.
A system can then rapidly adjust its resources, scaling out during periods of high demand and scaling in when the demand decreases.
Amazon EC2 Auto Scaling
Amazon EC2 Auto Scaling automatically adjusts the number of EC2 instances based on changes in application demand, providing better availability.
Auto Scaling groups
Auto Scaling groups are collections of EC2 instances that can scale in or out to meet your application’s needs.
Key settings:
Elastic Load Balancing
Elastic Load Balancing (ELB) automatically distributes incoming application traffic across multiple resources, such as EC2 instances, to optimize performance and reliability.
A load balancer serves as the single point of contact for all incoming web traffic to an Auto Scaling group.
As the number of EC2 instances fluctuates in response to traffic demands, incoming requests are first directed to the load balancer. From there, the traffic is distributed evenly across the available instances.
Although ELB and Amazon EC2 Auto Scaling are distinct services, they work in tandem to enhance application performance and ensure high availability.
ELB routing methods
Monolithic applications
In a traditional approach to application architecture, the components—such as database logic, web application servers, user interfaces, and business logic—are tightly coupled.
Microservices architecture
In this approach, application components are loosely coupled, meaning that if one component fails, the others continue to function normally.
The failure of a single component does not impact the entire system.
This design promotes greater flexibility and reliability in the application.
EventBridge
EventBridge is a serverless service that helps connect different parts of an application using events, helping to build scalable, event-driven systems.
Amazon SQS (Simple Queue Service)
Amazon SQS is a message queuing service that facilitates reliable communication between software components.
In Amazon SQS, an application places messages into a queue, and a user or service retrieves the message, processes it, and then removes it from the queue.
Amazon SNS
Amazon SNS is a publish-subscribe service that publishers use to send messages to subscribers through SNS topics.
Example of the different emails for each topic.
AWS pricing options