<h1 style='border: none'><center>Parallel and Distributed Systems Lab 4</center></h1> <h2 style='border: none'><center>Amazon Web Service(AWS)<br>RDS</center></h2> <h5><center>The Islamic University of Gaza<br>Engineering Faculty<br>Department of Computer Engineering</center></h5> <h6>Authors: Usama R. Al Zayan<span style="float:right">2022/10/28</span></h6> --- ## Amazon RDS Overview * RDS stands for Relational Database Service * It’s a managed DB service for DB use SQL as a query language. * It allows you to create databases in the cloud that are managed by AWS: • Postgres • MySQL • MariaDB • Oracle • Microsoft SQL Server • Aurora (AWS Proprietary database) ## Advantage over using RDS versus deploying DB on EC2 * RDS is a managed service: • Automated provisioning, OS patching • Continuous backups and restore to specific timestamp (Point in Time Restore)! • Monitoring dashboards • Read replicas for improved read performance • Multi AZ setup for DR (Disaster Recovery) • Maintenance windows for upgrades • Scaling capability (vertical and horizontal) • Storage backed by EBS (gp2 or io1) * BUT you can’t SSH into your instances ## Storage Auto Scaling * Helps you increase storage on your RDS DB instance dynamically * When RDS detects you are running out of free database storage, it scales automatically * Avoid manually scaling your database storage * You have to set Maximum Storage Threshold (maximum limit for DB storage) * Automatically modify storage if: • Free storage is less than 10% of allocated storage • Low-storage lasts at least 5 minutes • 6 hours have passed since last modification * Useful for applications with unpredictable workloads * Supports all RDS database engines (MariaDB, MySQL, PostgreSQL, SQL Server, Oracle) ## RDS Read Replicas for read scalabilit <center> ![](https://i.imgur.com/MfKALjT.png =500x) </center> * Up to 5 Read Replicas * Within AZ, Cross AZ or Cross Region * Replication is ASYNC, so reads are eventually consistent * Replicas can be promoted to their own DB * Applications must update the connection string to leverage read replicas ### RDS Read Replicas – Network Cost * In AWS there’s a network cost when data goes from one AZ to another * For RDS Read Replicas within the same region, you don’t pay that fee ![](https://i.imgur.com/FNcrqEU.png) ## How to Create RDS 1. Search for `RDS` service in the top search bar. ![](https://i.imgur.com/JkOAliv.png) 2. Click `Create database` Button. ![](https://i.imgur.com/lrojIz5.png) 3. Select Engine type. ![](https://i.imgur.com/AywyO3N.png) 4. Select `Free tier` template. ![](https://i.imgur.com/ioVaDjq.png) 5. Enter DB instance name, username and password. ![](https://i.imgur.com/J66PqTN.png) 6. Select `db.t2.micro` instance. ![](https://i.imgur.com/L0tsTOD.png) 7. Enter Allocated storage (min 20 GiB) and disable storage autoscaling. ![](https://i.imgur.com/EixyOOv.png) 8. You Can Connect DB to an EC2 instance directly, or set Public access as `yes`. ![](https://i.imgur.com/cPzrc3L.png) ![](https://i.imgur.com/Rq1bCFg.png) 9. Enter intial Database name and disable automated backups. ![](https://i.imgur.com/F3xW2SP.png) 10. Click `Create database`. ![](https://i.imgur.com/grYS4q0.png) ## Scalability & High Availability * **Scalability** means that an application / system can handle greater loads by adapting. * There are two kinds of scalability: • Vertical Scalability • Horizontal Scalability (= elasticity) * Scalability is linked but different to High Availability * **High availability** means running your application / system in at least 2 data centers (Availability Zones) * The goal of high availability is to survive a data center loss ### High Availability & Scalability For EC2 * **Vertical Scaling**: Increase instance size (= scale up / down) • From: t2.nano - 0.5G of RAM, 1 vCPU • To: u-12tb1.metal – 12.3 TB of RAM, 448 vCPUs * **Horizontal Scaling**: Increase number of instances (= scale out / in) • Auto Scaling Group • Load Balancer * **High Availability**: Run instances for the same application across multi AZ • Auto Scaling Group multi AZ • Load Balancer multi AZ ###### tags: `Parallel and Distributed Systems` `Cloud computing` `IUG` `Computer Engineering` <center>End Of Lab 4</center>