Ease with Amazon RDS [Amazon Relational Database Service]
Handling backend and database is a huge and cumbersome task and choosing the right service is even more difficult to opt for. Amazon Relational Database Service (Amazon RDS) makes it easy to set up, operate, and scale a relational database in the cloud. But still the thought pops up in our mind, why still we should go for Amazon RDS , what are the extra benefits and readiness we get from the AWS RDS. Let’s first start by knowing what Amazon RDS really is and later get a detail on how to Create a database step by step in RDS.
Amazon Relational Database Service (Amazon RDS) is a database service provided by amazon web services. It provides cost-efficient and resizable capacity while automating time-consuming administration tasks such as hardware provisioning, database setup, patching and backups. It’s a managed Database service for DB that uses SQL as a query language.
Mainly it allows you to create databases in the cloud that are then managed by AWS. It frees you to focus on your applications so you can give them the fast performance, high availability, security and compatibility they need. AWS RDS is used by large organizations like Netflix, Intuit, Expedia, Unilever, US Department of Veterans Affairs and many more.
Amazon RDS is available on several database instance types — optimized for memory, performance or I/O — and provides you with six familiar database engines to choose from, including Amazon Aurora, PostgreSQL, MySQL, MariaDB, Oracle Database, and SQL Server.
Advantage over using RDS versus deploying DB on EC2
RDS is a managed service which provides us provisions like automated provisioning of databases, Operating System(OS) patching, Continuous backups and restoration to specific timestamp. In this we also have monitoring dashboards, read replicas for improved read performance, multi AZ setup for DR(Disaster Recovery),maintenance windows for upgrades as well as scaling capability both vertical and horizontal and at last storage which is backed by EBS(gp2 or io1). The only drawback of RDS is that we do not have SSH into our instances.
RDS Backups
Backups are automatically enabled in RDS. These automated backups give the aid of daily full backup of the database during the maintenance window whereas transaction logs are also backed-up by RDS every 5 minutes which provides the ability to restore to any point in time (from oldest backup to 5 minutes ago). It contains a 7 days retention (can be increased to 35 days).DB Snapshots are backups that are manually triggered by the user and the retention backup for this is as long as you want.
RDS Read Replicas for read scalability
Here, we can create up to 5 Read Replicas which can be within Availability Zone(AZ), cross AZ or Cross region. ASYNC replication is performed in between the RDS DB instance read replica and RDS DB instance so reads are eventually consistent. These replicas can be promoted to their own database. In case we want to use read replicas, applications must update the connection string to leverage read replicas. Read replicas are used for SELECT(=read) 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. So, to reduce the cost, we can have the read replicas in the same AZ.
RDS Multi AZ (Disaster Recovery)
Here, SYNC replication occurs between RDS Master DB instance and RDS DB instance standby. So as a result of it we get a one DNS name and if there is something wrong with Master an automatic app failover happens to the standby DB. Because of this we get increased availability and failover in case of loss of AZ, loss of network, instance or storage failure. There is no need to do manual intervention in apps and also it is not used for scaling. Read Replicas can be setup as Multi AZ for Disaster Recovery(DR).
AWS RDS Hands On (Creating database)
- We search for the RDS at the first then go to Databases in the left panel on the screen and after that select Create Database.
2.Choose Standard Create from Database creation method.
3.Then go to Engine options where you can select the engine you prefer from the six listed ones.
● If you want to choose a free tier with RDS, Aurora does not work as it is not yet compatible for free tier. A suggestion is to go for MySQL because it is free tier compatible.
● Select MySQL Community in the Edition and go for the 5.7.22 version.
4.From Templates, choose Free tier which comes with few values already being set up for beginners.
5.Under Settings, name your database as per your choice in the DB instance identifier. Then, complete the credential settings by filling out an apt Master username and password.
6.Now, reaching at the DB instance size, db.t2.micro under Burstable classes(includes t classes) is selected as default because we chose template as Free tier. Others options are also available in case we choose Production or Dev/Test.
7.In Storage, set Storage type to General Purpose (SSD) and allocate storage to 20 GiB.
● In case you get a warning just increase size to 21 then back to 20 to fix it.
● In Storage auto-scaling, disable the option of Enable storage auto-scaling.
8.Under Availability & Durability, we can go for the Multi AZ deployment but in Free tier it is disabled.
9.In Connectivity, we go for the default VPC(vpc-d74714be) to launch the database.
● Afterwards in Additional connectivity configuration, let the Subnet group remain at default and in Publicly accessible set Yes to connect it to the database.
● In the VPC security group, select Create New and provide a suitable new VPC security group name. Choose the Availability zone as per your preference. Let the Database port be 3306 for MySQL.
10.In Additional configuration, set Initial database name as per your choice and let the other settings stay at default.
● For the Backup section, enable automatic backups and choose the Backup retention period as per your requirement.
● Set the backup window to No preference.
● Monitoring and Log exports for now are not chosen with any option but you can select as per your requirement.
● In the Maintenance section, enable the auto minor version upgrade and you can select when the Maintenance window will appear but for now set it to No preference.
● Then in Deletion protection, disable it for now.
After completing these all settings, you can see the estimated monthly costs and then go for Create Database which will take some time to build. Now you can access the database and connect it with relevant GUI to check its actual connectivity. In the rightmost corner of the running database you can see instance actions in which you have the option to Create Read Replica and Take Snapshot.
Benefits of Using RDS
● Fully managed
● Availability and reliability
● Ease of migration
● Fast predictable performance
● License flexibility
● Multiple availability zones
AWS RDS Pricing
Amazon RDS is free to try and you only pay only for what you use with no minimum fees. You can pay for Amazon RDS using On-Demand or Reserved Instances. Estimate your monthly bill using the AWS Pricing Calculator. As part of the AWS Free Tier, Amazon RDS helps new AWS customers get started for free with a managed database service in the cloud. Each calendar month, the Amazon RDS Free Tier allows you to use:
● 750 hours of Amazon RDS Single-AZ db.t2.micro Instance usage running MySQL, MariaDB, PostgreSQL, Oracle BYOL, or SQL Server (running SQL Server Express Edition).
● 20 GB of General Purpose (SSD) DB Storage.
● 20 GB of storage for your automated database backups and any user-initiated DB Snapshots.
In conclusion, choosing AWS RDS results in easy, faster and durable execution of backend saving us time and money. So, in our opinion you should give it a try and see yourself, the efficiency and effectiveness we can indulge in our tasks using AWS RDS. Access the video below for a clearer understanding.
Don’t Forget to subscribe our YouTube Channel for more updates.