Amazon Relational Database Service
- Amazon Relational Database Service (Amazon RDS) offers a web service designed to manage a relational database in a cloud.
- It is extremely easy to set up and operate while providing enough scalability. It is also very cost-effective.
- It provides a feature to access the full capabilities of MySql database. Using this allows you to create, edit and terminate a database in cloud. Amazon RDS also creates database instance (DB instance) in the cloud which is easy to create. It is typically created using command line argument or Amazon API. Amazon RDS creates a master user which is authorized to create, edit and delete a database. It can also perform certain actions such as selecting and inserting table and other database-related functions. A DB instance identifier is unique in the Amazon AWS which identifies particular instances when interacting with the Amazon API or command line. Database name is a name given in the DB instance, and Amazon RDS supports MySql database engine.
- To take advantage of the Amazon RDS, you need to use the Amazon web service management console or Amazon RDS API to launch database instance and connect with it using some programming language.
- Amazon RDS provides enough functionality to manage versions of database software running in DB instance. It helps in identifying where and how you can upgrade and patch it. In case you want to upgrade to a new version, the Amazon RDS will allow you to do so and perform tests. If you think it will affect your application, then you can deploy it. You can do this by modifying the DB instance in Amazon API or RDS-modify-Db instance in command line.
- It is very easy to deploy and it is compatible with existing tools and applications.
- It provides scalability and reliability.
- It is very secure since it uses the firewall setting that controls the overall access to the database.
- Amazon RDS creates a default time to maintain DB instance according to zones. Typically, this is four hours a week. We can change it too when creating a DB instance. For example, US East region is SUN: 5:00 – SUN 9:00 UTC.
- If you want to work on Amazon RDS with a specific region, you need to use region-specific end point. There are four regions namely the US_EAST-https://rds.us-east-1.amazonaws.com, US_WEST, EU and Asia, specifically. By default, it will take the US _East end point.
- One of most powerful features of Amazon RDS is its Multi AZ deployment. Amazon, by design, supplies and maintains a synchronous reserve replica in a different Availability Zone. With the help of Multi AZ deployment, Amazon RDS protects a DB instance. If any failure takes place, it provides data redundancy, offers back up, maintains DB instance and protects data against Zone disorder. Its primary database is constantly replicated across all availability zones to make sure that the replica is on standby for this functionality. You can use this feature by selecting the option called Multi AZ functionality during DB instance creation. You can also add it later on by modifying the DB instance.
- MySql provides a read-in replica function. When using this Amazon RDS, you can create replicated DB instance to the exiting one. For this, you can type CreateReadDb instance ReadReplica in API. One point to note is that you need to explicitly delete this replica because even though our source DB instance related to this replica is deleted, the replica will still accept and read traffic and stay active. Read replica works asynchronously so recent changes in the Source DB instance might not result to instant changes on the read replica.
- If you want to use DB instance for a longer period, then it’s better to use functionality-reserved DB instance provided by Amazon RDS. This enables you to reserve DB instance for a one-year or three-year term so as to benefit in billing because using this has a lower cost rate as compared to using DB instance at an hourly rate. It depends if it is a single instance or multi AZ instance or on the duration of DB instance, among others.
- Amazon RDS provides security to DB instance by applying security groups. To create database security group, supply it with a name and description. You need to give a range of IP addresses often provided by CIDR.
- You can backup your DB instance. Amazon RDS uses two types of back up. The first one is automated backup while the second one is snap shot. Automated backup is set by default when creating a new DB instance. You need to give a specific time for this back up which is known as back up retention period. Back up retention plan changes its zero values to a non-zero value. There is also a default window designed for backup for a specific region. Database snapshot is user-created with a known state, and it stays until you specifically delete it.
Let’s check out how to create a database instance in Amazon API.
Step 1) To access the RDS, first, you need to sign in. For the sign up page, visit https://aws.amazon.com/rds/ and click on Sign Up RDS.
After signing up, this page will appear. Fill out the appropriate fields and click Sign in.
After signing in, you can access the page which shows information about charges to use RDS. Click Complete Sign Up.
Now AWS will email you the ID that you entered to sign up.
The next step is to visit the AWS main page and click on RDS. A page like this will then appear. Click Launch Instance. This will create a new DB instance.
Step 3) The Launch DB Instance Wizard page will appear.
In the example, DB instance class small was selected. You can also choose large or medium based on your requirement.
The next step is to access the DB Engine version and select the version of MySql. If you want to change to the auto miner version, then select “yes”. And based on the discussion about Multi AZ deployment above, you just have to choose “yes” if you want this feature. We select No for this example.
RDS provides facility to store database ranging from 5GB to 1024 GB.
After this, supply a name to the DB instance identifier. In the example, the name given is “TechnoEncyclopedia”. Provide a master user name and password. Master users have authority to edit the instance and access functionality to MySql. Now click Continue.
Step 4) Now, time to add additional configurations.
Give name to databases, select by default, port 3306 and select availability zone. By default, it will take US_EAST.give security group default. And click Continue.
Step 5) Next is to set management option.
Give information about database maintenance and back up. Here we select all default values. Click on Continue.
This shows a review then click on Launch DB Instance.
Now as you can see the in the figure above, our DB instance is created.
Now as you can see in the main screen of RDS, one instance process is already running since creating it will take a few minutes. Starting status is created right after. It will change its status to available so you can start using it. When you select instance, it will show its property.
As you can seen in the figure, DB instance property end point is given. This is important for us to start our application on command prompt.
Step 9) before we start, we need to put a security. For this, go to DB security group.
Select Default, and then Property window; open below it. you need to provide a CIDR number as shown in the figure below. For this, select CIDR option in authentication.
Now enter CIDR number. And click on Add.
You can then go to command prompt window of MySql and type this:
PROMPT> mysql -h mydbinstance.charfod5bpa7.us-east-1.rds.amazonaws.com -P
3306 -u mymasteruser –p
Note here, at the end, it will supply your end point which is provided in DB instance property.
After doing this, if you want to terminate the instance, select the check box next to the DB Instance, and then click the Delete button at the top of My DB Instances page.
- This way, we can create a DB instance and access MySql. RDS. This is more secure as we can use group security option which is scalable. We can store more databases on our needs. This is reliable since RDS makes an automatic back up. So if there is a failure, our data stays intact in the sense that we can still access the full facility of MySQL. It is also inexpensive since the cost to store a database is very low.
- RDS price depends upon which type of instance class we select whether small, large or medium, as well as which availability zone we choose, Multi AZ functionality, Reserve Instance, among others.
- Lowest instance selected costs 0.11$ per hour, For multi AZ, $0.22 per hour; for small instance reserved for 1 year, it’s $227.50. So it varies according to our requirement.