RDS
Relational database has database which has rows and columns.
Rows:Is the data for fields
Columns: Has the titles of fields to represent the data.
Relational Database on AWS:
- SQL server
- Oracle
- MySql server
- PostgreSql
- Aurora
- MariaDB
RDS has two key features.
- Multi-AZ: For disaster recovery
When we observe the below pic, EC2 instance is hosting a website with DNS name : myexapledb...
and website is communicating with Primary database.But there is some issue with Primary database which stops functioning, so website automatically pointing to the Read replica server , which is a back up of the Primary database.This is called Multi-AZ disaster recovery to provide the HA for the website.
- Read replica: For performance: Which will give the HA to the website/app when disaster recovery happens.
Whenever data we are writing to the primary database , it automatically writing a backup to the other database which is read replica.
This is how it works when it starts reading from the read replica.
Non relational databases
In Non relational DB , There is no mandatory that every field will have the value but incase of RDS, every field(column) has the value.
For ex:
| Id | Name | Emp id | age | company |
| 1 | Krishna | ab12 | 30 | |
| 2 | Arjun | cd34 | 23 | TCS |
| 3 | sathya | ef22 | 35 |
OLTP:Online transaction processing, which provides the data for transaction basis
OLAP: Online Analytical Processing, which Provides the data analytical basis.
Elastic cache:
is a web service , that makes easy to deploy , operate and scale in-an memory cache in the cloud.
this service improves the performance of the webapps by allowing you to retrive information from fast, managed cache instead of relying on entirely slower disk based databases.
Caching will be done in two ways. i.e memcache and redis.
Redshift is a dataware housing technology and it is used for business intelligence purpose.
and this is OLAP purpose.
Simple task :
Creating website using wordpress and mysql server as backend using EC2.
Select RDS service under Data bases from the AWS services and create database.
select mysql and version
Template: Free tier
Name of the RDS instance: MySampleDB, this is not database name.
Backup retention period: 0 days and keep everything as default.
Finally click on "Create database".
After few mins Database will be created and it will be in "available" status.
Now lets go and create EC2 instance.
While creating EC2, instance PHP and mysql and tomcat by using the below script.
Bootstrap Script
#!/bin/bash
yum install httpd php php-mysql -y
cd /var/www/html
wget https://wordpress.org/wordpress-5.1.1.tar.gz
tar -xzf wordpress-5.1.1.tar.gz
cp -r wordpress/* /var/www/html/
rm -rf wordpress
rm -rf wordpress-5.1.1.tar.gz
chmod -R 755 wp-content
chown -R apache:apache wp-content
service httpd start
chkconfig httpd on
Once EC2 is up, you can copy your Public IP and paste it in the browser, you can see below page.
click on "lets go" Database host: RDS endpoint name
In my case its have to fill as below
once you click on submit it will show the below page
So, now you need to follow the above instruction.
i.e. We need to create the wp-config.php file and paste the following text into it.
connect to EC2 and and create a wp-config.php file and paste the content with Sudo access.
Now go back to the browser and click on "run the installation"
fill the form as below
After that click on "install word press" it will show the below page.
Now your wordpress is installed and with mysql database as database.
Now we successfully installed PHP,wordpress and able to setup RDS database(mysql) as backend.
Thank you for reading 👍👍👍👍👍
No comments:
Post a Comment