You are on page 1of 27

AWS Solutions Architect Professional Week-4

Topics to be covered
Week Broader Topic Topics Tools to be
covered
1. Introduction to Data:
1.1 Types of Data:

2. What is Database:
2.1 Types of Databases

3. AWS Relational Database Services Amazon


AWS 3.1 Amazon RDS shared RDS- MySQL
4 Database responsibility model
Services 3.1.1 DB instance classes
3.1.2 Supported DB engines
for DB instance classes
3.1.3 Amazon RDS storage
types
3.1.4Supported features in
Amazon RDS by AWS Region
and DB engine
3.1.5 DB instance billing for
Amazon RDS

4. Lab of RDS with MySQL

1
AWS Solutions Architect Professional Week-4

1. Introduction to Data:
A collection of unique, compact pieces of information are called data. It may be utilized in
many different ways, including as text, numbers, media, bytes, etc. It may be kept on paper,
in an electronic memory, etc.
The term "data" comes from the Latin word "datum," which meaning "a single piece of
information." It is the term datum's plural.
Data is information that can be transformed into a form for rapid transfer and processing in
computers. Data can be swapped out.

1.1 Types of Data:


Qualitative Data Type

• Nominal
• Ordinal
Quantitative Data Type

• Discrete
• Continuous

Qualitative Data Type:


This form of data can't be tracked or measured easily using numbers and is thus
classified into categories. The gender of a person (male, female, or others) is a good
example of this data type, which is typically derived from audio, photos, or text media.
Nominal-
These values are the group that lacks a natural ordering. Let's use some instances to
better understand this. Since we can't compare one hue to another, the colour of a
smartphone may be thought of as a nominal data type.
There is no way to say that Red is superior to Blue.
Ordinal-
These values preserve their class of values while having a natural ordering. If we take
a look at a clothing brand's size, we can simply arrange them by their name tag in the
following order: small, medium, big.

2
AWS Solutions Architect Professional Week-4

Quantitative Data Type:


This data type attempts to measure things, and it does so by taking into account
numerical quantities that lend the object to being countable. Quantitative data
categories include the cost of a smartphone, any discounts available, the number of
reviews left for a product, the processor speed or RAM of a certain phone, and many
more items.
Discrete-
Integers or whole numbers are the kind of numerical values that come under this
category. Some instances of the discrete data type are the number of speakers,
cameras, processing cores, and compatible SIM cards in a phone. Charts, such as bar
charts, pie charts, and tally charts, are frequently used to identify discrete data.
Continuous-
Fractional numbers are regarded as continuous quantities in mathematics. Examples
of volatile values that can be included in the continuous value are temperature and a
person's weight. Graphs are used to display continuous forms of statistical data
because they are easily able to show value fluctuations by the highs and lows of the
line throughout time.

2. What is Database:
A database is an organized collection of data. They enable the manipulation and storage of
data digitally. Data administration is made simple by databases.
Let's use a database as an example. A database is used to hold data about people, their phone
numbers, and other contact information in an online telephone directory.
Let's think about Facebook as well. Data from members, their friends, member activities,
messages, adverts, and much more must be stored, modified, and presented.

2.1 Types of Databases


Relational databases:
Data is arranged into rows and columns, which together make up a table in a relational
database. Usually, data is organized into several tables that may be linked together
using a primary key or a foreign key. These unique identifiers show the many
connections that exist between the tables; these connections are often shown
through various kinds of data models.
Consider a scenario in which your business has a database table of customer data that
includes account-level corporate information. Another table that lists every single

3
AWS Solutions Architect Professional Week-4

transaction that corresponds to that account may also exist. When combined, these
tables can reveal details about the various markets for a certain software product.
Example: MySQL, PostgreSQL, MariaDB, Microsoft SQL Server, and Oracle Database.

Important Aspects of Relational Databases:

• SQL
• Data Integrity
• Transactions
• ACID Compliance

SQL: Structured Query Language (SQL) The main means of communication with
relational databases is through language.

Data Integrity: The general completeness, correctness, and consistency of the


data is known as data integrity. In relational databases, data integrity is protected
by a set of constraints. These include main keys, foreign keys, "Not NULL,"
"Unique," "Default," and "Check" constraints, among others. In order to guarantee
the quality and dependability of the data, these integrity constraints aid in
enforcing business rules on the data in the tables.
Transactions:
A database transaction is made up of one or more SQL statements that are carried
out sequentially as one logical unit of work. The "all-or-nothing" nature of
transactions means that either the entire transaction must succeed and be
recorded to the database as a whole, or none of its component parts should be
successful. A transaction produces a COMMIT or a ROLLBACK in relational
database jargon. Each transaction is handled independently of other transactions
in a consistent and trustworthy manner.
ACID Compliance:
To maintain data integrity, all database transactions must comply with ACID, which
stands for Atomic, Consistent, Isolated, and Durable. Atomicity mandates that
either the entire transaction must be successfully completed, or if a portion of it
fails, the entire transaction must be invalidated. Consistency requires that all rules
and limits, such as constraints, cascades, and triggers, be followed when data is
written to the database as part of a transaction. Concurrency control is only
possible with isolation, which guarantees that each transaction is independent of
the others. Once a transaction has been successfully completed, all database
changes must be applied permanently in order for durability to be met.

4
AWS Solutions Architect Professional Week-4

Non-relational databases:
Non-relational databases don't have as strict of a database schema as relational databases,
which organize data in a tabular fashion. In actuality, depending on the kind of database, non-
relational database’s structure data differently. Regardless of the kind of non-relational
database, they all try to address the problems of relational models' rigidity and scalability that
make them unsuitable for unstructured data forms like text, video, and photos.
Example: MongoDB, Cassandra, Redis, Couchbase and Apache HBase
These databases consist of:

5
AWS Solutions Architect Professional Week-4

Key-value
store

Types of
Graph Non- Document
store relational store
databases

column
store

1. Key-value pair store:


You can store data in pairs with a distinct ID and a data value using key-value databases. Since
values are not tied to a table and may carry any quantity or kind of data, this offers a flexible
storage structure. Large amounts of data or requests can be managed by these databases.
Gaming apps, eCommerce platforms, and heavy traffic applications are examples of use cases
for key-value databases.
AWS service: Amazon DynamoDB
2. Document store:
Similar in structure to key-value databases, document databases store keys and values in
documents that are expressed in markup languages like JSON, XML, or YAML. These databases
may be used to hold data hierarchies by connecting documents. User profiles, catalogues ,
and content management are examples of use cases for document databases.
AWS service: Amazon Document DB, DynamoDB

3. Column store:
Although they are based on tables, column databases lack a rigid column structure. There is
no need that each column in a row include a value, and sections of rows and columns with

6
AWS Solutions Architect Professional Week-4

data in various formats can be mixed. Route optimization, fleet management, and industrial
maintenance applications are among the use cases for broad column databases.
AWS service: Amazon Keyspaces (for Apache Cassandra)

4. Graph store:
The structure of a graph database is a set of edges and nodes. Edges are the connections
connecting the nodes, which are the individual data values. With the help of these databases,
you may follow closely connected information in an organic network rather than an organized
table. Social networking, fraud detection, and recommendation engines are examples of use
cases for graph databases.
AWS service: Amazon Neptune

3. AWS Relational Database Services


The term "data for RDS service of AWS" refers to the data that is stored in the relational
database that is managed by the RDS service. This data can include information such as
customer records, financial transactions, inventory levels, and other structured data that is
organized into tables with predefined columns and data types.
RDS supports a variety of popular relational database engines, including Amazon Aurora,
PostgreSQL, MySQL, MariaDB, Oracle Database, and Microsoft SQL Server. Users can create
and manage databases within these engines using the AWS Management Console, the RDS
command-line interface, or the RDS API.
In addition to providing scalable and reliable infrastructure for storing and accessing data,
RDS also offers features such as automated backups, automated software patching, and the
ability to scale database instances up or down as needed. These features help simplify
database administration and allow users to focus on their applications and data rather than
the underlying infrastructure.

3.1 Amazon RDS shared responsibility model:


The infrastructure and software needed to run DB instances and DB clusters are hosted by
Amazon RDS. You are in charge of query optimization, which entails modifying SQL queries to
enhance performance. The database architecture, data amount, data distribution, application
workload, and query patterns which can vary greatly all have a significant impact on query
performance. You are solely responsible for the monitoring and optimization of your RDS
databases. To find troublesome queries, you can utilize tools like Amazon RDS Performance
Insights.

7
AWS Solutions Architect Professional Week-4

A cloud-based database instance is a standalone database environment. It is the fundamental


pillar of Amazon RDS. The same client tools and apps you may use to access a solo database
instance can be used to access a DB instance, which might include many user-created
databases.
You can have up to 40 Amazon RDS DB instances, with the following limitations:
• 10 for each SQL Server edition (Enterprise, Standard, Web, and Express) under the "license-
included"
model
• 10 for Oracle under the "license-included" model
• 40 for MySQL, MariaDB, or PostgreSQL
• 40 for Oracle under the "bring-your-own-license" (BYOL) licensing model

Amazon RDS creates a master user account for your DB instance as part of the creation process. This
master user has permissions to create databases and to perform create, delete, select, update, and
insert operations on tables the master user creates. You must set the master user password when you
create a DB instance, but you can change it at any time using the AWS CLI, Amazon RDS API operations,
or the 9 Amazon Relational Database Service User Guide DB instances AWS Management Console.
You can also change the master user password and manage users using standard SQL commands.

3.1.1 DB instance classes


The DB instance class determines the computation and memory capacity of an Amazon RDS
DB instance.
Amazon RDS supports three types of DB instance classes:

• General purpose
The following are the general-purpose DB instance types available:
db.m6g
db.m6gd
db.m6i
db.m5d
db.m5
db.m4
db.m3

• Memory-optimized
The following are the memory-optimized DB instance types available:
db.x2g
db.z1d
db.x2i
db.x1e
db.x1
db.r6g
db.r6gd

8
AWS Solutions Architect Professional Week-4

db.r6i
db.r5b
db.r5d
db.r5
db.r4
db.r3

• Burstable performance

The following are the burstable-performance DB instance types available:

db.t4g
db.t3
db.t2

3.1.2 Supported DB engines for DB instance classes


The following are DB engine–specific considerations for DB instance classes:

• Microsoft SQL Server


• Oracle
• MariaDB
• PostgreSQL
• MySQL

3.1.3 Amazon RDS storage types


Amazon RDS provides three storage types:
1. General Purpose SSD
2. Provisioned IOPS SSD
3. Magnetic

3.1.4Supported features in Amazon RDS by AWS Region and DB engine


Multiple sites throughout the world house the resources for Amazon's cloud computing. These
areas are made up of Local Zones, Availability Zones, and AWS Regions. AWS Regions are
geographically distinct regions. There are various, separated areas called Availability Zones
inside each AWS Region.

You may deploy resources, including computation and storage, in a number of places that are
nearer to your consumers by using Local Zones. You may spread out resources, such database
instances and data, using Amazon RDS. Unless you expressly request it, resources aren't
replicated between AWS Regions.

9
AWS Solutions Architect Professional Week-4

Availability Zones
When you create a DB instance, you can choose an Availability Zone or have Amazon RDS
choose one for you randomly. An Availability Zone is represented by an AWS Region code
followed by a letter identifier (for example, us-east-1a).
Local Zones
A Local Zone is an extension of an AWS Region that is geographically close to your users. A
subnet in a Local Zone is an option when creating a DB instance. Local Zones support AWS
Direct Connect and have their own internet connections. As a result, resources developed in
a Local Zone can provide very low-latency connections to local consumers.

3.1.5 DB instance billing for Amazon RDS


Amazon RDS provides the following purchasing options to enable you to optimize your costs
based on your needs:
• On-Demand instances - For the DB instance hours you utilize, you pay per the hour.
Although invoices are computed down to the second and display times in decimal form,
pricing is stated on an hourly basis. RDS consumption is now paid in 10-minute blocks
with 1-second increments.
• Reserved instances - Get a sizable discount on DB instance price when you prepay for a
period of one or three years for a DB instance. You can launch, remove, start, or stop
many instances within an hour using reserved instance use, and each instance will
receive the reserved instance advantage.

10
AWS Solutions Architect Professional Week-4

4.LAB of RDS with MYSQL :

Step1: To create a MySQL DB instance with Easy create


• Create Database Instance

11
AWS Solutions Architect Professional Week-4

• Click Create database to start the configuration process.

• Choose a database creation method


In the Chose a database create method section, select Standard Create.

• Next in Engine options select MySQL and, in the Edition, Section select MySQL
Community and also select the engine version.

12
AWS Solutions Architect Professional Week-4

13
AWS Solutions Architect Professional Week-4

Templates

• Choose a sample template to meet your use case.

• DB instance identifier:
Type a name for your DB instance. The name must be unique across all DB
instances owned by your AWS account in the current AWS Region.
• For Master username, enter a name for the master user, or keep the default
name.

• To use an automatically generated master password for the DB instance, select


Auto generate a password.

14
AWS Solutions Architect Professional Week-4

or
To enter your master password, make sure Auto generate a password is cleared,
and then enter the same password in Master password and Confirm password.

• Instance configuration

The DB instance configuration options below are limited to those supported by


the engine that you selected above.

15
AWS Solutions Architect Professional Week-4

• Storage: General Purpose SSD storage


General Purpose SSD storage offers cost-effective storage that is acceptable for
most database workloads that aren't latency sensitive. The following are the
storage size ranges for General Purpose SSD DB instances:

➢ MariaDB, MySQL, Oracle, and PostgreSQL database instances: 20 GiB–


64 TiB
➢ SQL Server Enterprise, Standard, Web, and Express Editions: 20 GiB–
16 TiB

• Choose whether to set up a connection to a compute resource for this database.


Setting up a connection will automatically change connectivity settings so that
the compute resource can connect to this database.
• Network type:
To use dual-stack mode, make sure that you associate an IPv6 CIDR block with a
subnet in the VPC you specify.
• Virtual private cloud (VPC):
Choose the VPC. The VPC defines the virtual networking environment for this DB
instance.

16
AWS Solutions Architect Professional Week-4

• Choose the DB subnet group. The DB subnet group defines which subnets and IP
ranges the DB instance can use in the VPC that you selected.
• Public access- Yes
• VPC security group (firewall):
Choose one or more VPC security groups to allow access to your database. Make
sure that the security group rules allow the appropriate incoming traffic.

• Database authentication
Database authentication options: Password authentication

17
AWS Solutions Architect Professional Week-4

• Now click on create database

• Now open the database and under security open security Groups

• Here open VPC Security Groups

18
AWS Solutions Architect Professional Week-4

• Now in Security Group open inbound rules and click on edit Inbound rules
Add rule: SSH
Change source : Anywhere (for testing purpose)
Save the changes

19
AWS Solutions Architect Professional Week-4

Step2: Create EC2 instance to access the database you have created
• Now got to Instances, click on Launch Instance and create Linux EC2 instance. Select
AMI- Amazon Linux 2023 AMI

20
AWS Solutions Architect Professional Week-4

• Now select Instance Type: T2micro


• Create a new KeyPair for this Machine (EC2 Instance)

• Edit the Network Setting’s


-Keep the VPC which you have configured with Database
-Subnet: Can create this machine in any of the subnet (Availability zone)
-Edit the Security Group: choose the security group which you have attached
with the database.

21
AWS Solutions Architect Professional Week-4

• Now click on Launch Instance

• Now view the instance and connect to this Linux instance

• For connection of Linux Machine we will use PuTTY and Puttygen

Download Link : https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html


Download two files:
SSH and Telnet client itself putty.exe
RSA and DSA key generation utility: puttygen.exe

22
AWS Solutions Architect Professional Week-4

• Now open Puttygen.exe file


• Click on Load Button

• Select the .pem file (KeyPair) which you have generated for the machine
• Select the file and click on Open

23
AWS Solutions Architect Professional Week-4

• Save it as a Private Key and click on yes


• It will get saved in .ppk format

• Open PuTTY.exe file and in Hostname mention Public IP address of the Ec2 machine

• Now in Connection, go to Data and fill Auto login user name- ec2-user

• Then under SSH -> Auth -> Credentials -> here browse the .ppk file you have
generated using Puttygen.exe
• Click on Open now

24
AWS Solutions Architect Professional Week-4

• Now machine got successfully connected

• Now using Root account install SQL on this machine


• Use the following commands to setup the MySQL on machine

1. sudo wget https://dev.mysql.com/get/mysql57-community-release-el7-


11.noarch.rpm
2. sudo yum localinstall mysql57-community-release-el7-11.noarch.rpm
3. rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
4. sudo systemctl start mysqld.service

25
AWS Solutions Architect Professional Week-4

• Now go back to AWS environment and open RDS database which you have
created
• click on the database and copy the Endpoint from details section

• Now open the terminal of Linux machine and use following command
• Mysql -h (endpoint of database) -u (username of database) -p (database
name)
• mysql -h database-1.cazlp2dlgfhx.us-east-1.rds.amazonaws.com -u admin -p
(databasename)
• Now database is ready.

26
AWS Solutions Architect Professional Week-4

Step3: Deletion of resources used


• Delete the database from RDS service

• Go to EC2 instances
• select the machine and Terminate it

27

You might also like