RDS

Amazon Relational Database Service (Amazon RDS)

RDS
  • Amazon Relational Database Service (Amazon RDS) is a web service that makes it easier to set up, operate, and scale a relational database in the AWS Cloud.

  • It provides cost-efficient, resizable capacity for an industry-standard relational database and manages common database administration tasks.

Benefits of AWS RDS

Easy to use

Amazon RDS makes it easy to create and manage a relational database, allowing users to focus on their applications and business logic, rather than on the underlying infrastructure.

Scalability

Amazon RDS allows users to easily scale their database up or down, depending on their needs, without having to worry about managing the underlying infrastructure.

High availability

Amazon RDS uses multiple Availability Zones to ensure that databases are highly available and can withstand outages. Security: Amazon RDS provides a number of built-in security features, such as encryption at rest and in transit, to help protect users’ data.

Cost-effective

Amazon RDS allows users to pay for only the resources they use, making it a cost-effective solution for managing relational databases.

Components of AWS RDS

  • DB instances

  • DB engines

  • DB Instance Class

  • DB instance Storage

  • VPC

  • Region and Availability Zones

  • Security

DB Instances

  • A DB instance is an isolated database environment in the AWS Cloud. The basic building block of Amazon RDS is the DB instance.

  • Your DB instance can contain one or more user-created databases.

  • You can access your DB instance by using the same tools and applications that you use with a standalone database instance.

  • You can create and modify a DB instance by using the AWS Command Line Interface (AWS CLI), the Amazon RDS API, or the AWS Management Console.

DB Engines

A DB engine is the specific relational database software that runs on your DB instance. Amazon RDS currently supports the following engines:

  • MariaDB

  • Microsoft SQL Server

  • MySQL

  • Oracle

  • PostgreSQL

Each DB engine has its own supported features, and each version of a DB engine can include specific features.

DB Instance Class

  • A DB instance class determines the computation and memory capacity of a DB instance.

  • A DB instance class consists of both the DB instance type and the size.

  • Each instance type offers different compute, memory, and storage capabilities.

For example, db.m6g is a general-purpose DB instance type powered by AWS Graviton2 processors, while db.m6g.2xlarge is a DB instance class within the db.m6g instance type.You can select the DB instance that best meets your needs. If your needs change over time, you can change DB instances

DB Instance Storage

Amazon EBS provides durable, block-level storage volumes that you can attach to a running instance. DB instance storage comes in the following types:

  1. General Purpose (SSD)

  2. Provisioned IOPS (PIOPS)

  3. Magnetic

  • The storage types differ in performance characteristics and price. You can tailor your storage performance and cost to the needs of your database.

  • Each DB instance has minimum and maximum storage requirements depending on the storage type and the database engine it supports.

  • It's important to have sufficient storage so that your databases have room to grow. Also, sufficient storage makes sure that features for the DB engine have room to write content or log entries.

VPC

  • You can run a DB instance on a virtual private cloud (VPC) using the Amazon Virtual Private Cloud (Amazon VPC) service.

  • When you use a VPC, you have control over your virtual networking environment.

  • You can choose your own IP address range, create subnets, and configure routing and access control lists.

  • The basic functionality of Amazon RDS is the same whether it's running in a VPC or not.

  • Amazon RDS manages backups, software patching, automatic failure detection, and recovery.

Region and Availability Zones

  • Amazon cloud computing resources are housed in highly available data center facilities in different areas of the world (for example, North America, Europe, or Asia).

  • Each data center location is called an AWS Region.

  • Each AWS Region contains multiple distinct locations called Availability Zones, or AZs. Each Availability Zone is engineered to be isolated from failures in other Availability Zones.

  • Each is engineered to provide inexpensive, low-latency network connectivity to other Availability Zones in the same AWS Region.

  • By launching instances in separate Availability Zones, you can protect your applications from the failure of a single location.

Security

A security group controls the access to a DB instance. It does so by allowing access to IP address ranges or Amazon EC2 instances that you specify.

How AWS RDS works

RDS Workflow

Read Replica

  • Amazon RDS Read Replicas provide enhanced performance and durability for Amazon RDS database (DB) instances.

  • They make it easy to elastically scale out beyond the capacity constraints of a single DB instance for read-heavy database workloads.

  • You can create one or more replicas of a given source DB Instance and serve high-volume application read traffic from multiple copies of your data, thereby increasing aggregate read throughput.

Multi-AZ Deployements

  • Multi-AZ deployments can have one standby or two standby DB instances. When the deployment has one standby DB instance, it's called a Multi-AZ DB instance deployment.

  • A Multi-AZ DB instance deployment has one standby DB instance that provides failover support, but doesn't serve read traffic.

  • When the deployment has two standby DB instances, it's called a Multi-AZ DB cluster deployment.

  • A Multi-AZ DB cluster deployment has standby DB instances that provide failover support and can also serve read traffic.

A Multi-AZ DB instance deployment has the following characteristics:

  • There is only one row for the DB instance.

  • The value of Role is Instance or Primary.

  • The value of Multi-AZ is Yes.

con-multi-AZ

A Multi-AZ DB cluster deployment has the following characteristics:

  • There is a cluster-level row with three DB instance rows under it.

  • For the cluster-level row, the value of Role is Multi-AZ DB cluster.

  • For each instance-level row, the value of Role is Writer instance or Reader instance.

  • For each instance-level row, the value of Multi-AZ is 3 Zones

multi-az-db-cluster

Amazon RDS Blue/Green Deployments

  • A blue/green deployment copies a production database environment to a separate, synchronized staging environment.

  • By using Amazon RDS Blue/Green Deployments, you can make changes to the database in the staging environment without affecting the production environment.

For example, you can upgrade the major or minor DB engine version, change database parameters, or make schema changes in the staging environment. When you are ready, you can promote the staging environment to be the new production database environment, with downtime typically under one minute.

Amazon RDS Blue/Green Deployments

  • A blue/green deployment creates a staging environment that copies the production environment.

  • In a blue/green deployment, the blue environment is the current production environment.

  • The green environment is the staging environment. The staging environment stays in sync with the current production environment using logical replication.

Workflow of a blue/green deployment

blue-green-deployment

Backups

  • Amazon RDS creates and saves automated backups of your DB instance or Multi-AZ DB cluster during the backup window of your DB instance.

  • RDS creates a storage volume snapshot of your DB instance, backing up the entire DB instance and not just individual databases.

  • RDS saves the automated backups of your DB instance according to the backup retention period that you specify. If necessary, you can recover your DB instance to any point in time during the backup retention period.

Automated backups follow these rules:

Your DB instance must be in the available state for automated backups to occur. Automated backups don't occur while your DB instance is in a state other than available, for example, storage_full.

Automated backups don't occur while a DB snapshot copy is running in the same AWS Region for the same database.

Rds Metrices

CPU

  • CPU Utilization – Percentage of computer processing capacity used.

Memory

  • Freeable Memory – How much RAM is available on the DB instance, in megabytes. The red line in the Monitoring tab metrics is marked at 75% for CPU, Memory and Storage Metrics.

  • If instance memory consumption frequently crosses that line, then this indicates that you should check your workload or upgrade your instance.

  • Swap Usage – How much swap space is used by the DB instance, in megabytes.

Disk space

Free Storage Space – How much disk space is not currently being used by the DB instance, in megabytes.

Input/output operations

  • Read IOPS, Write IOPS – The average number of disk read or write operations per second.

  • Read Latency, Write Latency – The average time for a read or write operation in milliseconds.

  • Read Throughput, Write Throughput – The average number of megabytes read from or written to disk per second.

  • Queue Depth – The number of I/O operations that are waiting to be written to or read from disk.

Network Traffic

  • Network Receive Throughput, Network Transmit Throughput – The rate of network traffic to and from the DB instance in bytes per second.

Database connections

  • DB Connections – The number of client sessions that are connected to the DB instance.

AWS RDS Creation

Step 1

  • Sign in to the AWS Management Console and open the Amazon RDS console

Step 2

  • In the navigation pane, choose Databases.

  • Choose Create database and make sure that Standard create is chosen

  • In Configuration, choose PostgreSQL

  • Also choose PostgreSQL version 11

  • Give public access to our database

  • Enable VPC DNS hostname and DNS resolution

  • Create Security Group and give inbound connection to your database

Step 3

  • Choose templates as our selection in the development we use free tier.

  • Next give some details about database identifier and credential details for our database

Step 4

  • Choose our instance and storage type and volume

  • Disable auto scaling in the test environment

Step 5

  • Set connectivity details choose IPV4

  • Next choose our VPC and subnet group

  • Subnet group is a used to run RDS . Database only runs in two subnets so we can group 2 subnets and create a subnet group.

  • Choose public access type

Step 6

  • Select VPC security group for traffic monitoring and configuring

  • Choose our security group and availability zone of our RDS and set database port

  • Choose Database Authentication type

Step 7

  • Choose monitoring options and click create database

Pricing

Last updated