RDS stands for Amazon Relational Database Service is a web service that allows you to easily setup and scale relational database on AWS Cloud.
Amazon RDS will handle difficult tasks or management tasks:
- You can allocate CPU, IOPS or storage in a customized manner
- RDS uses AWS backup service for data backup, automatic error detection and recovery
- Do not support accessing RDS instance through the shell
- You can backup automatically or manually Snapshot
- High self-synchronization between primary and secondary
- Control access to RDS through IAM, protect the database by pushing to the virtual private cloud
DB Instances
The DB instance is a separate type of database environment within the AWS cloud.
You can create or edit DB instances through the AWS CLI, RDS API and AWS management console
Each DB instance will run a DB engine
RDS supports the following engines:
- MySQL
- MariaDB
- PostgreSQL
- Oraccle
- Microsoft SQL server
DB instance storage has 3 types
- Magnetic
- General Purpose (SSD)
- Provisioned (PIOS) Each DB instace has a storage limit depending on the type and database it supports.
DB Instance Billing for Amazon RDS
The calculation of money is based on the following components used:
- DB instance hours (per hour): Based on the DB instance class of the DB instance, The price will be listed by the hour, But your invoice will be calculated in seconds and the minimum for RDS billing is 10 minutes.
- Storage (GiB / month): If you scale provisioned storage capacity for the month. Then bill will be pro-rated
- I / O request (1 million requests per month): Applies to RDS magetic type
- Provisioned IOPS (per IOPS per month)
- Backup storage (per GiB per month): Backup storage is the storage automatically linked to database backups
- Data transfer (per GB): Data transfer of instance data to outside or other services of AWS
Prerequirement
You will create the database inside the DB instance.
The DB instance will provide the network address (endpoint). The application will use this endpoint to connect to the DB instance.
You will need details settings storage, memory, engine / version, network, security, maintenance period when creating a DB instance.
Control access to DB instance through security group
Before creating a DB instance and a security group, you need to identify what the DB instance and security group need:
Resource requirements
Memory and processor required for the application
VPC, subnet and security group
DB instance is like VPC (Virtual Private Cloud). To connect to the DB instance you need to install security goup rules. These rules are different for each VPC you use
Default VPC
If your AWS account has a default VPC on the current AWS region, then this VPC has been configured to support the DB instance. If you choose the default VPC when creating a DB instance, then follow these steps:
- Create a VPC security group to authenticate the link from the application to the Amazon RDS DB instance with the database.
- Select the default DB subnet group. Amazon RDS will create a default DB subnet group when creating a DB instance if this is the first time you create a DB instance.
User-defined VPC
Some important things to note
- Make sure that the VPC security group has authenticated the connection between the application and from Amazon RDS to the database.
- VPC must meet certain conditions to host a DB instance, such as having at least 2 subnets per AZ
- Use a DB subnet group to define subnets in VPC
No VPC
If your AWS account does not have a default VPC and you did not select a user-defined VPC
High availability
Amazon RDS, Multi-AZ deployment will create a primary DB instance and a secondary standby DB instance in another AZ to support failover when an error occurs.
IAM policies
Your IAM account must be authorized by Amazon RDS.
Open ports
Make sure the firewall does not block the default port for the database engine. You can edit the port by editing the DB instance
AWS Region
Your database and application should select regions near each other to reduce network latency
DB disk subsystem
Depending on the purpose of use, you choose 1 of 3 types of Magnetic (Standard Storage), General Purpose (SSD), Provisioned IOPS (PIOPS)
Refer
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Welcome.html