AWS Relational Database Service (RDS) Overview

AWS Relational Database Service (RDS) Overview

RDS stands for Relational Database Service. It’s managed DB service for DB use SQL as a query language.

It allows you to create database in the cloud that are managed by AWS:

  • Postgress
  • MySQL
  • Oracle
  • MariaDB
  • MSSQL
  • 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
  • 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

RDS Backups:

  • Backups are automatically enabled in RDS.
  • Automated backups:
    • Daily full backup of the database
    • Transaction logs are backed-up by RDS every 5 minutes
    • ⇒ ability to restore to any point in time (from oldest backup to 5 minutes ago)
    • 7 days retention (can be increased to 35 days)
  • DB Snapshots:
    • Manually triggered by the user
    • Retention of backup fo as long as you want

RDS - Storage Auto Scaling

image.png

  • 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 scalability

image.png

  • 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
  • Application must update the connection string to leverage read replicas

RDS Read Replicas — Use Cases

  • You have a production database that is taking on normal load
  • You want to run a reporting application to run some analytics
  • You create a Read Replica to run the new workload there
  • The production application is unaffected
  • Read replicas are used for SELECT (=red) only kind of statements (not INSERT, UPDATE, DELETE)

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

image.png

RDS Multi AZ (Disaster Recovery)

image.png

  • SYNC replication
  • One DNS same — automatic app failover to standby
  • Increase availability
  • Failover in case of loss of AZ, loss of network, instance or storage failure
  • No manual intervention in apps
  • Not used for scaling

Note: The Read Replicas be setup as Multi AZ for Disaster Recovery (DR).

RDS - From Single-AZ to Multi-AZ

image.png

  • Zero downtown operation (no need to stop DB)
  • Just click on “modify” for the database
  • The following happens internally:
    • A snapshot is taken
    • A new DB is restored from the snapshot in a new AZ
    • Synchronization is established between the two databases