DEV Community

Pranav Bakare
Pranav Bakare

Posted on

3 most commonly used AWS services - S3,EC2,RDS

The top 3 most commonly used AWS services are:

1. Amazon S3 (Simple Storage Service)

  • Purpose: Scalable object storage service.
  • Use Cases: Storing and retrieving any amount of data such as backups, application data, media files, and static websites.

2. Amazon EC2 (Elastic Compute Cloud)

  • Purpose: Provides resizable virtual server instances in the cloud.
  • Use Cases: Running scalable applications, hosting websites, databases, or any workload requiring compute power.

3. Amazon RDS (Relational Database Service)

  • Purpose: Managed relational database service for databases like MySQL, PostgreSQL, Oracle, and SQL Server.
  • Use Cases: Deploying, managing, and scaling relational databases with minimal administrative effort.

These services are popular because they provide flexible and scalable infrastructure for a wide range of applications and use cases.
.
.
.
.

1. Amazon S3 (Simple Storage Service)

Overview:

Amazon S3 is an object storage service that offers industry-leading scalability, data availability, security, and performance. It allows users to store and retrieve any amount of data, from anywhere on the web, at any time. S3 is designed for 99.999999999% (11 9’s) durability, meaning your data is highly protected and available.

Features:

  • Storage classes: S3 offers various storage classes such as S3 Standard (for frequently accessed data), S3 Intelligent-Tiering (automatically moves data to the most cost-efficient storage tier), S3 Glacier (for long-term archive).
  • Versioning: Allows keeping multiple versions of an object.
  • Data encryption: Data is encrypted both in transit and at rest.
  • Access control: Manage permissions with AWS Identity and Access Management (IAM), bucket policies, or Access Control Lists (ACLs).

Use Cases:

  • Backup and restore
  • Media hosting (videos, images, etc.)
  • Data lakes for big data analytics
  • Static website hosting

Sample Example:

Let’s say you want to store images for a photo-sharing application. You would create an S3 bucket to store those images, and users would upload their images to that bucket. S3 will scale automatically as the number of users and images grows.

# Create an S3 bucket using AWS CLI
aws s3 mb s3://my-photo-app-bucket

# Upload a file to S3
aws s3 cp myimage.jpg s3://my-photo-app-bucket/

Enter fullscreen mode Exit fullscreen mode

2. Amazon EC2 (Elastic Compute Cloud)

Overview:

Amazon EC2 is a web service that provides scalable computing capacity in the cloud. It enables you to launch virtual servers (EC2 instances) to run your applications. EC2 offers complete control over the computing resources and allows you to choose CPU, memory, storage, and networking capacity tailored to your needs.

Features:

  • Variety of instance types: EC2 provides different instance types based on use cases (General-purpose, Compute-optimized, Memory-optimized, etc.).
  • Auto Scaling: Automatically adjusts the number of EC2 instances according to the demand of your application.
  • Elastic Load Balancing: Distributes incoming traffic across multiple EC2 instances.
  • Amazon Machine Images (AMIs): Pre-configured virtual machines that provide the information required to launch instances.

Use Cases:

  • Hosting web applications and services
  • Running backend servers or microservices
  • Big data analytics and machine learning
  • Gaming servers

Sample Example:

Let’s say you are hosting a website that receives a lot of traffic. You can create an EC2 instance running a web server (e.g., Apache or Nginx) to serve your application.


# Using AWS CLI to launch an EC2 instance
aws ec2 run-instances --image-id ami-0abcdef12345 --count 1 --instance-type t2.micro --key-name MyKeyPair

Enter fullscreen mode Exit fullscreen mode

This command launches an EC2 instance using a specified Amazon Machine Image (AMI) and instance type. Once the EC2 instance is up, you can connect to it, configure your web server, and start serving your website.

3. Amazon RDS (Relational Database Service)

Overview:

Amazon RDS is a managed relational database service that supports multiple database engines such as MySQL, PostgreSQL, Oracle, SQL Server, and MariaDB. It automates time-consuming tasks such as hardware provisioning, database setup, patching, and backups. RDS also provides automatic backups, snapshots, and multi-AZ deployments for enhanced availability.

Features:

  • Automated backups: RDS automatically backs up your database and retains the backups based on your defined retention period.
  • Multi-AZ deployments: Provides high availability by replicating data across multiple availability zones.
  • Read replicas: Improve read performance by creating read replicas.
  • Scalability: Easily scale the compute and storage resources of your database with just a few clicks.

Use Cases:

  • Running production databases for web and mobile applications
  • Enterprise-grade applications requiring high availability
  • Database solutions for e-commerce platforms, CRM, or content management systems

Sample Example:

Imagine you're running an e-commerce site and need a reliable and scalable database to store customer data, order information, and inventory. With Amazon RDS, you can launch a managed MySQL database.


# Create a MySQL database using RDS
aws rds create-db-instance \
    --db-instance-identifier my-ecommerce-db \
    --allocated-storage 20 \
    --db-instance-class db.t3.micro \
    --engine mysql \
    --master-username admin \
    --master-user-password mypassword \
    --backup-retention-period 7

Enter fullscreen mode Exit fullscreen mode

This command creates an RDS MySQL instance with the specified configuration. Amazon RDS will handle tasks such as backups, scaling, and patching, allowing you to focus on your application.


Summary:

S3 is best for storing objects like images, videos, and backups.
EC2 provides virtual servers to run your applications.
RDS offers managed relational databases for scalable and reliable data storage.

Top comments (0)