7 - CT071-3-3-DDAC - Database Solutions in Cloud
7 - CT071-3-3-DDAC - Database Solutions in Cloud
Cloud
CT071-3-3-D D A C ( Ve rs i o n #VE1)
Chapter 7
Database Solutions in Cloud
Which AWS service helps developers quickly deploy resources which can make use
of different programming languages, such as .NET and Java?
Choice Response
A AWS CloudFormation
B AWS SQS
• Vendor lock-in.
• Difficulty integrating data with other systems.
• Complex and lengthy migrations.
• Underestimating cloud costs.
• Possibility of connection downtime .
• Cloud security concerns.
Unmanaged: Managed:
Scaling, fault tolerance, and Scaling, fault tolerance, and
availability are managed by availability are typically built
you. into the service.
AWS Cloud
Users Application
Servers Amazon RDS
M
Microsoft SQL Server
• Network performance
PostgreSQL
Amazon RDS DB DB Instance Storage
main instance • Magnetic MariaDB
• General Purpose (solid state drive, or SSD)
• Provisioned IOPS Oracle
DB engines
VPC
Public subnet
Internet
Users gateway Amazon EC2
Private subnet
Amazon RDS
VPC
Public subnet
M Synchronous S
Amazon RDS RDS Standby
instance instance
VPC
Public subnet
M Synchronous S
Amazon RDS RDS Standby
instance instance
Functionality
Amazon EC2 Application
• Use for read-heavy database workloads
• Offload read queries Private subnet
P R
Amazon RDS Read replica
primary instance instance
High throughput
Web and mobile applications Massive storage scalability
High availability
Low-cost database
Ecommerce applications Data security
Fully managed solution
Use Amazon RDS when your application • Do not use Amazon RDS when your
requires: application requires:
• Complex transactions or complex • Massive read/write rates (for
queries example, 150,000 write/second)
• High durability
Module Code & Module Title Slide Title SL IDE 23
A m a z o n R D S : C l o c k- h o u r b i l l i n g a n d d a t a b a s e c h a ra c te r i sti c s
Clock-hour billing –
– Resources incur charges when running
Database characteristics –
– Physical capacity of database:
• Engine
• Size
• Memory class
Module Code & Module Title © 2022, Amazon Web Services, Inc.SloidreitTsitlaeffiliates. All rights reserved. SLID24E
A m a z o n R D S : D B p u r c h a s e t y p e a n d m u l ti p l e D B i n s t a n c e s
DB purchase type –
– On-Demand Instances
• Compute capacity by the hour
– Reserved Instances
• Low, one-time, upfront payment for database instances that are reserved
with a 1-year or 3-year term
Number of DB instances –
– Provision multiple DB instances to handle peak loads
Module Code & Module Title © 2022, Amazon Web Services, Inc.SloidreitTsitlaeffiliates. All rights reserved. SLI 2D5E
A m a z o n RDS: Storage
Provisioned storage –
– No charge
• Backup storage of up to 100 percent of database storage for an active
database
– Charge (GB/month)
• Backup storage for terminated DB instances
Additional storage –
– Charge (GB/month)
• Backup storage in addition to provisioned storage
Module Code & Module Title © 2022, Amazon Web Services, Inc.SloidreitTsitlaeffiliates. All rights reserved. SLI 2D6 E
A m a z o n R D S : D e p l o y m e n t t y p e a n d d a t a t ran sfe r
Requests –
– The number of input and output requests that are made to the
database
Data transfer –
– No charge for inbound data transfer
– Tiered charges for outbound data transfer
Module Code & Module Title © 2022, Amazon Web Services, Inc.SloidreitTsitlaeffiliates. All rights reserved. SLI 2D7 E
To p i c 2: k e y t a ke a w a y s
• With Amazon RDS, you can set up, operate, and scale relational databases in the
cloud.
• Features –
– Managed service
– Accessible via the console, AWS Command Line Interface (AWS CLI), or application programming
interface (API) calls
– Scalable (compute and storage)
– Automated redundancy and backup are available
– Supported database engines:
• Amazon Aurora, PostgreSQL, MySQL, MariaDB, Oracle, Microsoft SQL Server
AWS Cloud
Availability Zone A Availability Zone B
VPC: 10.0.0.0/16
Public subnet 1: Public subnet 2:
10.0.0.0/24 10.0.2.0/24
Internet Security group
Internet NAT Web
gateway gateway Server
Module Code & Module Title © 2022, Amazon Web Services, Inc.SloidreitTsitlaeffiliates. All rights reserved. SLID30E
Yo u r Ta s k
Security group
Create a VPC security group.
Private subnet
Create a DB subnet group.
Module Code & Module Title © 2022, Amazon Web Services, Inc.SloidreitTsitlaeffiliates. All rights reserved. SLI3D1E
Final product
AWS Cloud
Availability Zone A Availability Zone B
VPC: 10.0.0.0/16
Public subnet 1: Public subnet 2:
10.0.1.0/24 10.0.2.0/24
Module Code & Module Title © 2022, Amazon Web Services, Inc.SloidreitTsitlaeffiliates. All rights reserved. SLI 3D2E
Learning outcome 3: Identify the functionality in Cloud-based NoSQL
Database Service.
N O S Q L D ATA B A S E S E R V I C E
• Purpose-built for specific data models and stores data in flexible schemas.
• Scale easily for modern applications.
• Use a variety of data models for accessing and managing data.
• These types of databases are optimized specifically for applications that require
flexible data models, large data volume, and low latency.
• Achieved by relaxing some of the data consistency restrictions of
relational databases.
• Stores data in columns rather than rows. An example of the kind of data you might store
• Highly scalable and flexible. in a wide-column data store
• Data is organized into column families,
which are groups of columns that share
the same attributes.
• Each row is identified by a unique row
key, and the columns in that row are
further divided into column names and
values.
• Can store large amounts of data within a
single column.
• Reduce disk resources and the time it
takes to retrieve information from it.
• Store and query highly connected data. An example of a social network graph
• Data can be modeled in the form of entities
(also referred to as nodes, or vertices) and the
relationships between those entities (also
referred to as edges).
• Results can be returned in the form of literals,
lists, maps, or graph traversal paths.
• Provide a set of query languages that contain
syntax designed for traversing a graph
structure or matching a certain structural
pattern.
• Scalability
– typically designed to scale out by using distributed clusters of hardware, as opposed to scaling up by adding
expensive and robust servers.
• High performance
– Optimized for specific data models and access patterns.
– These enable higher performance than if you were trying to accomplish similar functionality with relational
databases.
• Highly functional
– provide highly functional APIs and data types that are purpose-built for each of their respective data
models.
Module Code & Module Title Slide Title SL IDE 40
U s e c a s e s of N o S Q L d a t a b a s e s
• Need flexible schemas that enable faster and more iterative development.
• Prioritize performance over strong data consistency and maintaining relationships
between data tables (referential integrity).
• Require horizontal scaling by sharding across servers.
• Support for semi-structured and unstructured data.
Table
Items
Attributes
P
a
Sort key
(Optional)
Primary key components
Partition key
(Required) r
SensorB 2021-03-04T11:21:20 28
SensorLocation table
SensorReadings table
{
"person_id" : 123,
JSON
"last_name" : "Doe", String Boolean
"first_name" : "John", Number
"next_anniversary" :
Document item {
"year" : 2021, Map
"month" : 5,
"day" : 30
},
"children" :
["Paulo", "Richard", "Jane", "Mary" List
]
}
Partition Partition
key: A key: B
{ {
"AnimalType": "Turtle", "AnimalType": "Dog",
DynamoDB "Name": "Quincy", "Name": "Rover",
hash function <other attributes> <other attributes>
} }
Partition {
DynamoDB stores the new "AnimalType": "Dog",
"Name": "Spot",
item among the others
<other attributes>
with the same partition }
key in ascending order by
sort key. Pets table Different Partition
}
"Genre": "Rock"
Same partition key as the table but
different sort key
Module Code & Module Title Slide Title SL IDE 52
Read consistency
Answer: 30 RCUs
Answer: 14 WCUs
AWS Cloud
Database
???
AWS AppSync
AWS Lambda AWS Lambda