AWS Cheat Sheet – RDS

AWS-cheat-sheet-RDS-main

Amazon RDS is the main database service of AWS, make sure you know as much as you can about it with this cheat sheet.

General:

  • Its fully managed database service in the cloud.
  • Supported databases: Oracle, MySQL, PostgreSQL, Aurora (Amazon SQL DB), SQL Server, MariaDB.
  • Scale underlying hardware automatically.
  • Existing databases can be migrated to Amazon RDS using native tools and techniques that vary depending on the engine

Database Engines:

  • Amazon RDS supports six database engines: MySQL, PostgreSQL, MariaDB, Oracle, SQL Server, and Amazon Aurora.

MySQL:

  • MySQL is one of the most popular open-source databases in the world.
  • RDS MySQL allows you to connect using standard MySQL tools such as MySQL Workbench or SQL Workbench/J.
  • supports Multi-AZ deployments for high availability and read replicas for horizontal scaling.

PostgreSQL:

  • Amazon RDS PostgreSQL can be managed using standard tools like pgAdmin and supports standard JDBC/ODBC drivers.
  • PostgreSQL supports Multi-AZ deployment for high availability and read replicas for horizontal scaling.

MariaDB:

  • MariaDB is a popular open-source database engine built by the creators of MySQL.
  • MariaDB adds features that enhance the performance, availability, and scalability of MySQL
  • has support for Multi-AZ deployment and read replicas.

Oracle:

  • Oracle is one of the most popular relational databases used in the enterprise and is fully supported by Amazon RDS.
  • Amazon RDS Oracle supports three different editions of the popular database engine: Standard Edition One, Standard Edition, and Enterprise Edition.
EditionPerformanceMulti-AZEncryption
Standard One++++YESKMS
Standard++++++++YESKMS
Enterprise++++++++YESKMS and TDE

Microsoft SQL Server:

  • Microsoft SQL Server is another very popular relational database used in the enterprise.
  • Amazon RDS SQL Server also supports four different editions of SQL Server: Express Edition, Web Edition, Standard Edition, and Enterprise Edition
EditionPerformanceMulti-AZEncryption
Express+NoKMS
Web++++NoKMS
Standard++++YesKMS
Enterprise++++++++YesKMS and TDE

Amazon Aurora:

  • Amazon Aurora is a fully managed service and is MySQL- compatible out of the box.
  • Amazon Aurora can deliver up to five times the performance of MySQL without requiring changes to most of your existing web applications.
  • You can use the same code, tools, and applications that you use with your existing MySQL databases with Amazon Aurora.
  • When you first create an Amazon Aurora instance, you create a DB cluster. A DB cluster has one or more instances and includes a cluster volume that manages the data for those instances.
  • An Amazon Aurora DB cluster consists of two different types of instances:
    • Primary Instance: This is the main instance, which supports both read and write workloads. When you modify your data, you are modifying the primary instance.
    • Amazon Aurora Replica: This is a secondary instance that supports only read operations.
  • Each DB cluster can have up to 15 Amazon Aurora Replicas in addition to the primary instance.

Storage Options:

  • Amazon RDS is built using Amazon Elastic Block Store (Amazon EBS).
  • Depending on the database engine and workload, you can scale up to 4 to 6TB in provisioned storage and up to 30,000 IOPS.
  • Amazon RDS supports three storage types:

Magnetic:

  • also called standard storage.
  • offers cost-effective storage that is ideal for applications with light I/O requirements.

General Purpose (SSD):

  • also called gp2.
  • can provide faster access than magnetic storage.
  • This storage type can provide burst performance to meet spikes and is excellent for small- to medium-sized databases.
  • For most applications, General Purpose (SSD) is the best option and provides a good mix of lower-cost and higher-performance characteristics.

Provisioned IOPS (SSD):

  • Provisioned IOPS (SSD) storage is designed to meet the needs of I/O-intensive workloads, particularly database workloads, that are sensitive to storage performance and consistency in random access I/O throughput.

Backup and Recovery:

Backup:

  • Amazon RDS provides two mechanisms for backing up the database:
    • Automated Backups:
      • An automated backup is an Amazon RDS feature that continuously tracks changes and backs up your database.
      • Amazon RDS creates a storage volume snapshot of your DB Instance, backing up the entire DB Instance and not just individual databases.
      • You can set the backup retention period when you create a DB Instance. One day of backups will be retained by default, you can modify the retention period up to a maximum of 35 days.
      • when you delete a DB Instance, all automated backup snapshots are deleted and cannot be recovered. 
      • Automated backups will occur daily during a configurable 30-minute maintenance window called the backup window.
      • You can restore your DB Instance to any specific time during the retention period, creating a new DB Instance.
      • Backup data is stored in S3.
      • You get free storage space equal to the size of your database.
      • During the backup, storage I/0 may be suspended and you may experience extended latency.
    • Manual DB Snapshots:
      • you can perform manual DB snapshots at any time.
      • A DB snapshot is initiated by you and can be created as frequently as you want.
      • You can restore the DB Instance to the specific state in the DB snapshot at any time.
      • DB snapshots are kept until you explicitly delete them with the Amazon RDS console or the DeleteDBSnapshot action.

Recovery:

  • Amazon RDS allows you to recover your database quickly whether you are performing automated backups or manual DB snapshots.
  • You cannot restore from a DB snapshot to an existing DB Instance; a new DB Instance is created when you restore.
  • When you restore a DB Instance, only the default DB parameter and security groups are associated with the restored instance.

High Availability with Multi-AZ:

  • Multi-AZ deployments, allows you to create a database cluster across multiple Availability Zones.
  • Multi-AZ allows you to place a secondary copy of your database in another Availability Zone for disaster recovery purposes
  • Amazon RDS can increase the availability of your database using replication.
  • Multi-AZ lets you meet the most demanding RPO and RTO targets by using synchronous replication to minimize RPO and fast failover to minimize RTO to minutes.
  • Multi-AZ deployments are available for all types of Amazon RDS database engines.
  • Amazon RDS automatically replicates the data from the master database or primary instance to the slave database or secondary instance using synchronous replication.
Multi-AZ Amazon RDS architecture
  • Amazon RDS automatically performs a failover in the event of any of the following:
    • Loss of availability in primary Availability Zone.
    • Loss of network connectivity to primary database.
    • Compute unit failure on primary database.
    • Storage failure on primary database.
  • Failover between the primary and the secondary instance is fast, and the time automatic failover takes to complete is typically one to two minutes.
  • Multi-AZ deployments are for disaster recovery only; they are not meant to enhance database performance
  • In a fail-over scenario, the same DNS name is used to connect to the secondary instance, There is no need to reconfigure your application.
  • If Multi AZ is enabled, then snapshots will be taken of the secondary database and there will be no performance impact on your primary db.
  • Amazon Aurora instances stores copies of the data in a DB cluster across multiple Availability Zones in a single AWS Region, regardless of whether the instances in the DB cluster span multiple Availability Zones.

Scalability:

Vertical Scalability:

  • Scaling verticaly is adding additional compute, memory, or storage resources to your database.
  • To change the amount of compute and memory, you can select a different DB Instance class of the database.
  • After you select a larger or smaller DB Instance class, Amazon RDS automates the migration process to a new class with only a short disruption and minimal effort.
  • Each database instance can scale from 5GB up to 6TB in provisioned storage depending on the storage type and engine.
  • Storage expansion is supported for all of the database engines except for SQL Server.

Horizontal Scalability with Partitioning:

  • Partitioning a large relational database into multiple instances or shards is a common technique for handling more requests beyond the capabilities of a single instance.
  • Partitioning, or sharding, allows you to scale horizontally to handle more users and requests but requires additional logic in the application layer.

Horizontal Scalability with Read Replicas:

  • Allow you to have a read-only copy of your prod database.
  • Read replicas are currently supported in Amazon RDS for MySQL, PostgreSQL, MariaDB, and Amazon Aurora
  • SQL Server and Oracle are not supported 
  • You can have up to 5 read replicas of your main database for MySQL, PostgreSQL, and MariaDB. NOT supported on ORACLE.
  • Updates made to the source DB Instance are asynchronously copied to the read replica.
  • Read Replicas can be promoted to be their own databases, however, this breaks replication.
  • You can create one or more replicas of a database within a single AWS Region or across multiple AWS Regions.
  • To enhance your disaster recovery capabilities or reduce global latencies, you can use cross-region read replicas.

Multi-AZ VS Read Replicas:

Multi-AZ deploymentsRead replicas
Main purpose is high availabilityMain purpose is scalability
Only the database engine on the primary instance is active (Aurora: all instances are active)all read replicas are accessible and can be used for read scaling
Automated backups are taken from standbyno backups are configured by default
always span two AZ within a single regioncan be within a single AZ, cross-AZ, cross-region.
Automated failover to standby when a problem is detectedcan be manually promoted to a standalone database instance
Non-Aurora: synchronous replication; Aurora: asynchronous replicationAsynchronous replication.

Security:

  • Protect access to your infrastructure resources using AWS Identity and Access Management (IAM) policies that limit which actions AWS administrators can perform.
  • deploy your Amazon RDS DB Instances into a private subnet within an Amazon Virtual Private Cloud (Amazon VPC) that limits network access to the DB Instance.
  • restrict network access using network Access Control Lists (ACLs) and security groups to limit inbound traffic to a shortlist of source IP addresses.
  • At the database level, you will also need to create users and grant them permissions to read and write to your databases.
  • Create users at the database level with strong passwords that you rotate frequently.
  • protect the confidentiality of your data in transit and at rest with multiple encryption capabilities provided with Amazon RDS.
  • You can securely connect a client to a running DB Instance using Secure Sockets Layer (SSL) to protect data in transit.
  • Encryption at rest is possible for all engines using the Amazon Key Management Service (KMS) or Transparent Data Encryption (TDE).

Pricing:

  • Pay only for what you use.
  • You can pay for Amazon RDS using On-Demand or Reserved Instances.
  • RDS is essentially a service running on top of EC2 instances, you will be charged based on DB instance hours, Storage (per GB per month), I/O requests per month, Provisioned IOPS per month, Backup Storage, Data transfer.

RDS video from AWS:


RDS practice questions:

RDS practice questions (Associate level)

/49

You need to log in to pass this practice exam.

If you don’t have an account create one


Notice: we keep updating this material.

AWSBOY Cheat sheets:

AWS Cheat sheet – VPC

AWS Cheat sheet – S3

AWS Cheat sheet – EC2

AWS Cheat sheet – IAM

AWS Cheat sheet – Route53

You can report a mistake or suggest new points to add to this RDS cheat sheet…let us know in the comment section!

Processing…
Success! You're on the list.

Leave a Reply

Your email address will not be published.

You cannot copy content of this page