0% found this document useful (0 votes)
159 views5 pages

AWS RDS Complete Guide

Uploaded by

TAIYABA FATHIMA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
159 views5 pages

AWS RDS Complete Guide

Uploaded by

TAIYABA FATHIMA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

AWS RDS - Complete Guide

Amazon RDS (Relational Database Service) in AWS

What is RDS in AWS?


Amazon Relational Database Service (RDS) is a managed database service provided by AWS that
makes it easy to set up, operate, and scale relational databases in the cloud.
Instead of manually installing and managing database software, patching, backups, and scaling,
RDS automates these tasks so you can focus on using the database.

Features of Amazon RDS


1. Fully Managed – AWS automates provisioning, patching, backups, monitoring, and scaling.
2. Multi-AZ Deployment – Provides high availability by automatically replicating data to a standby
instance in another Availability Zone.
3. Read Replicas – For read-heavy workloads, you can create replicas to offload read traffic.
4. Automated Backups – Continuous backups with point-in-time recovery.
5. Scalability – Scale compute (instance size) and storage independently.
6. Monitoring & Security – Integration with Amazon CloudWatch, IAM, VPC, and encryption (KMS).
7. High Performance – Supports provisioned IOPS for fast and predictable performance.
8. Multi-Region Read Replicas – For global applications with lower latency.
9. Cost-Effective – Pay only for what you use, supports on-demand and reserved instances.

Architecture & Working of RDS

RDS sits between your application and the database engine as a


managed layer:
1. Application Layer – Your app (running on EC2, Lambda, ECS, etc.) sends queries.
2. RDS Endpoint – Provides a DNS endpoint for your application to connect to.
3. Primary Instance – The main DB instance where read/write operations happen.
4. Standby Instance (Optional) – In Multi-AZ, a synchronous standby replica is maintained for
failover.
5. Read Replicas – Asynchronous replicas used for scaling read queries.
6. Storage Layer – Uses Amazon EBS for underlying storage with automatic backups and
snapshots.

Database Engines Supported by RDS


1. Amazon Aurora (MySQL/PostgreSQL-compatible, AWS’s own highly available engine)
2. MySQL
3. PostgreSQL
4. MariaDB
5. Oracle Database
6. Microsoft SQL Server

Specifications of RDS
- Compute Options: Multiple instance types (from t3.micro to r6g.16xlarge)
- Storage Options: General Purpose SSD (gp2/gp3), Provisioned IOPS (io1/io2)
- Max Storage: Up to 64 TiB depending on DB engine
- Backups: Automated backups + manual snapshots
- Networking: Deployed inside Amazon VPC with security groups and subnet groups
- Monitoring: CloudWatch metrics, Enhanced Monitoring, Performance Insights
- Security: Encryption at rest (KMS), encryption in transit (SSL/TLS), IAM authentication

Synchronous vs Asynchronous Replication in RDS

Synchronous Replication (Multi-AZ in RDS)


- In synchronous replication, every write (INSERT/UPDATE/DELETE) operation is committed to the
Primary DB and to the Standby DB at the same time.

- How it works:
1. Application writes to the Primary DB instance.
2. RDS replicates the transaction synchronously to the Standby DB instance in another AZ.
3. The write is only considered successful when both Primary and Standby acknowledge.
4. If the Primary fails, AWS automatically fails over to the Standby.
- Use Case: High Availability & Disaster Recovery.

Asynchronous Replication (Read Replicas in RDS)


- In asynchronous replication, data changes from the Primary DB are sent to Read Replica(s) after
the transaction is committed.

- How it works:
1. Application writes to the Primary DB instance.
2. RDS commits the transaction on Primary immediately (fast response).
3. Changes are then asynchronously shipped to Read Replica(s).
4. Applications can direct read-only queries (SELECT) to the replicas to offload traffic.
- Use Case: Scaling reads (e.g., high-traffic apps, analytics, reporting).

Comparison Table
| Feature | Multi-AZ (Synchronous) | Read Replica (Asynchronous) |
|-----------------------|-------------------------|------------------------------|
| Replication type | Synchronous | Asynchronous |
| Use case | High Availability (HA) | Read scalability, reporting |
| Failover | Automatic | Manual promotion |
| Read access | Not allowed | Allowed (read-only queries) |
| Replication lag | Zero (always in sync) | Non-zero (small delay) |
| Regions | Same Region (AZs only) | Same or cross-region |

Failover in AWS RDS

Failover in RDS (Multi-AZ)


- Multi-AZ automatically sets up a standby DB instance in another Availability Zone.

- Process:
1. Application connects to RDS Endpoint (DNS).
2. All queries go to Primary DB, standby updated synchronously.
3. If Primary DB fails, AWS promotes Standby as new Primary.
4. RDS Endpoint DNS is updated to point to new Primary.
5. Application reconnects to same endpoint after ~30–120 seconds downtime.

Failover in Read Replicas


- Read Replicas are not automatically promoted.
- You must manually promote a Read Replica to standalone DB in case of failure.
- Then, app must point to the new DB endpoint.

Real-World Scenario Example: E-Commerce App with RDS

Architecture Setup
- Frontend: Web app (EC2, ECS, or Lambda).
- Backend: Amazon RDS MySQL with Multi-AZ + Read Replicas.
- Primary DB: Handles all writes + reads.
- Standby DB: Synchronous replication for failover.
- Read Replicas: Asynchronous replication for scaling reads.

Normal Operation
- Browsing (reads) → Served by Read Replicas.
- Checkout (writes) → Goes to Primary DB (synchronously replicated to Standby).
- Analytics team → Runs heavy queries on Read Replicas.

Failure Scenario
- If Primary crashes, RDS promotes Standby automatically.
- DNS updates to point to new Primary.
- Application resumes with minimal downtime.

High-Traffic Scenario (Sale Event)


- Add more Read Replicas for scaling.
- Replication starts asynchronously, load distributed.

Disaster Recovery (Region Failure)


- Use Cross-Region Replicas.
- Promote cross-region replica manually in disaster recovery case.

Key Benefits for E-Commerce


- High Availability (Multi-AZ).
- Scalability (Read Replicas).
- Durability (Backups & Snapshots).
- Global Reach (Cross-Region Replicas).
Diagram 1: AWS RDS Architecture

Diagram 2: AWS RDS Replication (Synchronous vs


Asynchronous)

You might also like