Sunday, 27 November 2016

Amazon RDS

RDS Essentials

RDS is fully managed relational DB in cloud. Does not allow access to underlying OS. Can connect to DB server itself as normal ex. cmd line. Ability to provision/resize hardware on demand. Multi-AZ deployments. Read Replicas for reading efficiently (MySQL/PostgreSQL/Aurora).

Supported DB engines :

  • MySQL
  • PostgreSQL
  • Oracle
  • Microsoft SQL Server
  • Aurora
RDS Disk space Minimum - 5 GB and Maximum - 3 TB

SSD gives burstable performance. Provisioned IOPS gives the specified performance.

Benefits of running our own RDS instance instead of a Relational DB hosted on an EC2 instance,
  • Automatic minor updates
  • Automatic backups
  • No need to manage OS
  • Multi-AZ
  • Automatic recovery in case of failure
Automatic AZ fail-over - Multi AZ sync/replication of data to backup instances located in another availability zone in same region, In event of a failure AWS will automatically change the cname for that RDS instance to the standby/backup instance. In following cases the failover takes place,
  • Availability zone outage
  • Primary DB instance fails
  • Instance server type changed
  • Manual failover initiated
  • Updating software
  • Backups taken against standby instance to reduce I/O freezes and slow down if multi-AZ is enabled
RDS Backups : Automated point in time backups are provided by AWS. Eg. MySQL requires InnoDB for reliable backups.

Read Replicas : Replicas of original instance used for Read only
  • MySQL/postgreSQL/Aurora support
  • Uses native replication on by MySQL/PostgreSQL
  • Can be created from other read replicas
  • Read replicas are only supported by InnoDB MySQL storage engine.
  • Can offload tasks off of production DB
  • Can promote a read replica to a primary instance
  • MySQL
    • Replicate for importing/exporting to RDS
    • Can replicate across regions

When to use Read replicas ???

  • High non cached DB read traffic
  • Running business function such as data warehousing
  • Importing/Exporting data in RDS
  • Rebuilding indexes
    • Can promote Read Replica to primary
RDS integrates with CloudWatch and also many events can be notified.

As compared to EC2, here AWS has access to underlying OS it can manage many metrics like memory, swap usage etc. In case of EC2 AWS doesn't have access to OS, so we have to install the custom scripts for monitoring other factors.


RDS Subnet Groups

In order for high availability an RDS instance must be in different AZs. Here comes the part of Subnet Groups. We create an RDS instance, it automatically creates a standby in different AZ as part of Multi-AZ failover.

RDS Security Groups

RDS instances can share same SGs as that of EC2s or different. Same port rules n source rules apply to RDS SGs.



No comments:

Post a Comment