How Can We Help?

AWS RDS

You are here:
< All Topics

 RDS is the AWS Relational Database Service

 

 

a managed DB service for DB, uses SQL, is a “serverless service”, which runs:

 

Postgres
MySQL
MariaDB
Oracle
MS SQL Server
AWS Aurora (AWS proprietary DB)

 

 

You have to know this for the exam!

 

Advantages of RDS vs a db engine on an EC2 instance

 

rds is managed by AWS
automated provisioning, os and db engine upgrades and patching
continuous backups and point-in-time restore
monitoring dashboards
read replicas for improved read performance
multi-AZ for disaster recovery (DR)
maintenance windows for upgrades
scaling capacity, both horizontal and vertical
storage backed by EBS

 

BUT . you can’t SSH into the RDS instances – we don’t have access to the engine or underlying OS. RDS is purely a managed DB solution.

 

RDS Backups

 

automatically enabled
automated
daily full backup
transaction logs backed up every 5 mins
can restore to any point in time
7 days retention, can be increased to 35 days

 

 

DB Snapshots

 

rds db snapshots have to be manually triggered by user

retention for as long as you want

 

 

 

RDS Storage Auto Scaling

 

dynamic increase in storage is automatic – so this avoids manual scaling, but you have to set a Max Storage Threshold ie limit for db storage – exam question!

 

set rds to automatically modify storage if:

 

free storage is less than 10% of allocated storage

 

low storage lasts at least 5 mins

6 hrs have passed since last modification

 

useful for apps with unpredictable workloads

 

supports all rds DB engines – MariaDB, MySQL, PostgreSQL, SQL server and Oracle

 

 

Read Replicas with RDS

 

RDS read replicas provide for faster reads, but not for writes

 

you create a replica of the DB – up to 5 MAX – can be in the same AZ, cross AZ or cross-region – not needed for exam!

 

Asynchronous replication takes place – but there is a time lag involved.

 

hence:  “eventually consistent async replication”

 

exam question:
a replica can be promoted to become a full separate read-write DB.

 

application clients must update connection string to connect to the read replica/s.

 

a very typical exam question use case example:

 

eg prod DB but you need to run intensive read analysis eg reporting…

 

this would slow down the prod DB, so you can create a read replica to run the read process from there.

 

note: only SELECT type statements can be run ie reads, NOT insert, update, delete etc

 

 

Cost:

 

normally a charge for data transfer from one AZ zo another

 

but AWS does not charge for RDS read replica data traffic within the same REGION

 

ie is for free

 

BUT cross-region is chargeable…

 

Using RDS Multi-AZ for Disaster Recovery (DR)

 

This is a common use case for multi-az RDS systems.

 

This uses sync replication – this means that when the application writes to the master db instance, it is also written to the standby DB instance in the other AZ at the same time.

 

one dns name, auto app failover to the standover, this increases availability, meaning there is no manual intervention in apps necessary for the changeover. 

 

Note that it is not used for scaling, just for failover from master db in the event of a failure of the master db.

 

Note that a lot of questions in exam focus on RDS!

 

the read replicates can also be set up as multi-az for DR – this is often an exam question! In this case they switch from async replication to sync replication.

 

 

How to Move RDS from Single-AZ to Multi-AZ

 

There is no need to stop DB – just click on modify for the db

 

how it happens:

 

a snapshot is done automatically from master db and this is then restored from snapshot to a new db in the new az

 

 

a sync is then done. You then have a multi-AZ RDS DR setup.

 

 

 

my rds test database:

 

Endpoint & port
Endpoint: database-1.c2duk8wm0bjt.us-east-1.rds.amazonaws.com
Port  3306

 

 

More on RDS 

 

its a managed db on the postgresql/myswl/Oracle/SQL level

 

you must however an ec2 instance and ebs vol type and sufficient size

 

it supports read replicas and multi-AZ
security is via iam and security groups, kms, and ssl in transit
backup, snapshot and point in time restores all possible

 

managed and scheduled maintanance

 

monitoring available via cloudwatch

 

 

use cases include:

 

storing relational datasets rdbms/oltp performing sql queries, transactional inserts, update, delete is possible

 

rds for solutions architect, considerations include these “5 pillars”:

 

operations
security
reliability
performance
cost

 

 

operations_ small downtimes when failover happens, when maintenance happens, when scaling read replicas, ec2 instances, and restoring from ebs, this requires manual intervention, and when application changes

 

 

security: aws is responsible for os security, but we are responsible for setting up kms, security groups, iam policies, authorizing users in db and using ssl

 

 

reliability: the multi-az feature makes rds v reliable, good for failover in failure situations

 

performance: dependent on ec2 instance type, ebs vol type, can add read replicas, storage autoscaling is possible, and manual scaling of instances is also possible

 

costs: is pay per hour based on provisioned number and type of ec2 instances and ebs usage

 

 

Tags:
Table of Contents