[go: up one dir, main page]

0% found this document useful (0 votes)
39 views66 pages

7 - CT071-3-3-DDAC - Database Solutions in Cloud

The document discusses database solutions in the cloud, including relational and non-relational database services. It explores Amazon RDS as a managed relational database service, outlining the functionality it provides and advantages over on-premises databases. Key topics covered include types of cloud databases, considerations for using cloud databases, and responsibilities when using managed database services.

Uploaded by

unclerogerishere
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views66 pages

7 - CT071-3-3-DDAC - Database Solutions in Cloud

The document discusses database solutions in the cloud, including relational and non-relational database services. It explores Amazon RDS as a managed relational database service, outlining the functionality it provides and advantages over on-premises databases. Key topics covered include types of cloud databases, considerations for using cloud databases, and responsibilities when using managed database services.

Uploaded by

unclerogerishere
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 66

D e s i g n i n g a n d D e v e l o p i n g A p p l i c a ti o n s o n t h e

Cloud
CT071-3-3-D D A C ( Ve rs i o n #VE1)
Chapter 7
Database Solutions in Cloud

Module Code & Module Title Slide Title SL IDE


TOPIC LEARNING OUTCOMES
At the end of this topic, you should be able to:
1. Explore the database solutions in cloud.
2. Identify the functionality in Cloud-based Relational Database Service.
3. Identify the functionality in Cloud-based NoSQL Database Service.

Module Code & Module Title Slide Title SL IDE 2


Contents & Structure

• Database Solutions in Cloud


• Relational Database Service
• NoSQL Database Service

Module Code & Module Title Slide Title SL IDE 3


Recap From Last Lesson

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

C AWS Elastic Beanstalk

D Amazon Elastic Compute Cloud (Amazon EC2)

Module Code & Module Title Slide Title SL IDE 4


Learning outcome 1: Explore the database solutions in cloud.
D ATA B A S E S O L U T I O N S I N C L O U D

Module Code & Module Title Slide Title SL IDE


Cloud Databases

• A database built to run in a public or hybrid cloud environment.


• Help organize, store, and manage data.
• Can be offered as:
1. Managed database-as-a-service (DBaaS)
2. Deployed on a cloud-based virtual machine (VM) and self-managed by an in-house IT team

Module Code & Module Title Slide Title SL IDE 6


Ty p e s of C l o u d D a t a b a s e s

Relational cloud databases Non-relational cloud databases


• Consist of one or more tables of columns and • Store and manage unstructured data, such as
rows email and mobile message text, documents,
• Organize data in predefined relationships. surveys, rich media files, and sensor data.
• Use a fixed data schema. • Don’t follow a clearly-defined schema.
• Can use structured query language (SQL) to query • Allow to save and organize information
and manipulate data. regardless of its format.
• Highly consistent, reliable, and best suited to • Examples: MongoDB, Redis,
dealing with large amounts of structured data. Cassandra,
• Examples: SQL Server, Oracle, MySQL, Hbase, Amazon DynamoDB, etc.
PostgreSQL, Amazon RDS, etc.

Module Code & Module Title Slide Title SL IDE 7


A d v a n t a g e s of C l o u d D a t a b a s e s

• Reduced operational overhead.


• Improved agility and scalability.
• Lower total cost of ownership (TCO)
• Flexible database options.
• Safe, secure data.
• Better reliability.

Module Code & Module Title Slide Title SL IDE 8


C o n s i d e ra ti o n of u s i n g C l o u d D a t a b a s e

• Vendor lock-in.
• Difficulty integrating data with other systems.
• Complex and lengthy migrations.
• Underestimating cloud costs.
• Possibility of connection downtime .
• Cloud security concerns.

Module Code & Module Title Slide Title SL IDE 9


To p i c 1: k e y t a ke a w a y s
• Cloud databases have become an important component of modern
enterprise data management.
• They offer businesses numerous benefits, including scalability,
flexibility, cost efficiency and improved data security.
• There are 2 types of cloud databases:
– Relational Cloud Databases
– Non-Relational Cloud Databases

Module Code & Module Title Slide Title SL IDE 10


Learning outcome 2: Identify the functionality in Cloud-based Relational
Database Service.
R E L AT I O N A L D ATA B A S E S E R V I C E

Module Code & Module Title Slide Title SL IDE


U n m a n a g e d versus m a n a g e d services

Unmanaged: Managed:
Scaling, fault tolerance, and Scaling, fault tolerance, and
availability are managed by availability are typically built
you. into the service.

Module Code & Module Title Slide Title SL IDE 12


C h a l l e n g e s of relati onal d a t a b a s e s
• Server maintenance and energy footprint
• Software installation and patches
• Database backups and high availability
• Limits on scalability
• Data security
• Operating system (OS) installation and patches

Module Code & Module Title Slide Title SL IDE 13


Amazon RDS

Managed service that sets up and operates a relational database in the


cloud.

AWS Cloud

Users Application
Servers Amazon RDS

Module Code & Module Title Slide Title SL IDE 14


F r o m o n - p r e m i s e s d a t a b a s e s to A m a z o n R D S
Database in Amazon Elastic Database in Amazon RDS or
On-premises database Compute Cloud (Amazon EC2) Amazon Aurora

Application optimization Application optimization Application optimization


Scaling Scaling Scaling
High Availability High Availability High Availability
Database backups Database backups Database backups
Database software patches Database software patches Database software patches
Database software installs Database software installs AWS Database software installs
Operation system patches Operation system patches provides Operation system patches
Operating system install Operating system install Operating system install
Server maintenance Server maintenance Server maintenance
Rack and stack servers Rack and stack servers Rack and stack servers
Power, HVAC, network Power, HVAC, network Power, HVAC, network
AWS
provides

Module Code & Module Title Slide Title SL IDE 15


M a n a g e d s e r v i c e s responsibiliti es
You manage:
• Application optimization

Cloud provider manages:


• OS installation and patches
• Database software installation and patches
• Database backups
• High availability
• Scaling Amazon RDS
• Power and racking and stacking servers
• Server maintenance
Module Code & Module Title Slide Title SL IDE 16
A m a zo n R D S D B instances
Amazon RDS =
MySQL

DB Instance Class Amazon Aurora


• CPU
• Memory

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

Module Code & Module Title Slide Title SL IDE 17


A m a z o n R D S in a virtual p r i vate c l o u d ( V P C )
AWS Cloud
Availability Zone

VPC
Public subnet

Internet
Users gateway Amazon EC2

Private subnet

Amazon RDS

Module Code & Module Title Slide Title SL IDE 18


H i g h availability w i t h Multi -A Z d e p l o y m e n t (1 of 2)
AWS Cloud
Availability Zone 1 Availability Zone 2

VPC
Public subnet

Amazon EC2 Application

Private subnet Private subnet

M Synchronous S
Amazon RDS RDS Standby
instance instance

Module Code & Module Title Slide Title SL IDE 19


H i g h availability w i t h Multi -A Z d e p l o y m e n t (2 of 2)
AWS Cloud
Availability Zone 1 Availability Zone 2

VPC
Public subnet

Amazon EC2 Application

Private subnet Private subnet

M Synchronous S
Amazon RDS RDS Standby
instance instance

Module Code & Module Title Slide Title SL IDE 20


A m a z o n R D S r e a d re p l i ca s
Features AWS Cloud
• Offers asynchronous replication Availability Zone

• Can be promoted to primary if needed VPC


Public subnet

Functionality
Amazon EC2 Application
• Use for read-heavy database workloads
• Offload read queries Private subnet

P R
Amazon RDS Read replica
primary instance instance

Module Code & Module Title Slide Title SL IDE 21


Use cases

 High throughput
Web and mobile applications  Massive storage scalability
 High availability

 Low-cost database
Ecommerce applications  Data security
 Fully managed solution

 Rapidly grow capacity


Mobile and online games  Automatic scaling
 Database monitoring

Module Code & Module Title Slide Title SL IDE 22


W h e n to U s e A m a z o n R D S

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)

• A medium to high query or write • Sharding due to high data size or


rate throughput demands
– Up to 30,000 IOPS (15,000 • Simple GET or PUT requests and
reads + queries that a NoSQL database can
15,000 writes) handle

• No more than a single worker node • Relational database management


or shard system (RDBMS) customization

• 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

Deployment type—Storage and I/0 charges vary, depending on whether you


deploy to –
– Single Availability Zone
– Multiple Availability Zones

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

Module Code & Module Title Slide Title SL IDE 28


C l a s s A c ti v i t y
1:
Using 30 minutes to do this hands-on activity.
In this hands-on activity, you will:
• Learn how to use an AWS managed database instance to solve a need
fora relational database.

Module Code & Module Title Slide Title SL IDE 29


Scenario

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

Private subnet 1: Private subnet 2:


10.0.1.0/24 10.0.3.0/24

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.

Create an Amazon RDS DB instance and interact with


your database.
Amazon RDS

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

Internet Security group


NAT Web
Internet
gateway gateway Server

Private subnet 1: Private subnet 2:


10.0.3.0/24 10.0.4.0/24
Security group Security group
RDS DB RDS DB
Primary Secondary

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

Module Code & Module Title Slide Title SL IDE


NoSQL Database

• 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.

Module Code & Module Title Slide Title SL IDE 34


Ty p e s of N o S Q L d a t a b a s e s

• The common NoSQL database categories as below:


1. Key-value pair
2. Document-oriented
3. Column-oriented
4. Graph-based

Module Code & Module Title Slide Title SL IDE 35


K e y - Va l u e D a t a b a s e

• A type of database that stores An example of data stored as key-value pairs.


data as a collection of key-value
pairs.
• Each data item is identified by a
unique key, and the value
associated with that key can be
anything, such as a string,
number, object, or even another
data structure.

Module Code & Module Title Slide Title SL IDE 36


D o c u m e n t - o r i e nte d D a t a b a s e
An example of a document data model
• The data is stored in documents.
• Each document is typically a nested structure of keys
and values.
• The values can be atomic data types, or complex
elements such as lists, arrays, nested objects, or child
collections.
• Documents are retrieved by unique keys.
• It may also be possible to retrieve only parts of a
document.
• Transfer the application code object model
directly
into a document using several different formats:
– JavaScript Object Notation (JSON), Binary JavaScript Object
Notation (BSON), Extensible Markup Language (XML)
Module Code & Module Title Slide Title SL IDE 37
C o l u m n - o r i e nte d D a t a b a s e

• 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.

Module Code & Module Title Slide Title SL IDE 38


G ra p h - b a s e d D a t a b a s e

• 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.

Module Code & Module Title Slide Title SL IDE 39


A d v a n t a g e s of N o S Q L d a t a b a s e s
• Flexibility
– provide flexible schemas that enable faster and more iterative development.
– ideal for semi-structured and unstructured data.

• 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

• Real-time data management


• Cloud security
• High-availability applications

Module Code & Module Title Slide Title SL IDE 41


N o S Q L a n d S Q L d a ta b a s e s : D i ff e re n c e s

Relational or SQL Nonrelational or NoSQL

Data Storage Rows and columns Key-value, documents, and graphs

Schemas Fixed Dynamic

Querying SQL-based queries Focused on collection of documents

Scalability Vertical Horizontal

Module Code & Module Title Slide Title SL IDE 42


W h e n s h o u l d y o u c h o o s e N o S Q L d a t a b a s e s ove r
S Q L databases?

• 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.

Module Code & Module Title Slide Title SL IDE 43


B a s i c c o m p o n e n t s of D y n a m o D B

Table
Items
Attributes
P
a

Sort key
(Optional)
Primary key components
Partition key
(Required) r

Module Code & Module Title Slide Title SL IDE 44


Ty p e s of p r i m a r y k e y s

Simple primary key Composite primary key


(partition key only) (partition key and sort key)

SensorId Latitude Longitude SensorId Time Value


(Partition Key) (Partition Key) (Sort Key)

SensorA 40.712784 -74.005941 SensorA 2021-01-03T10:15:30 30

SensorB 35.689488 139.691706 SensorA 2021-01-04T10:19:30 35

SensorB 2021-03-04T11:21:20 28
SensorLocation table
SensorReadings table

Module Code & Module Title Slide Title SL IDE 45


I t e m s a n d att r i b u te t y p e s
ItemNumber Title LeadActor Price InCirculation
Key-value item
12 "My Favorite Video" "Mateo Jackson" 5.00 true

{
"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
]
}

Module Code & Module Title Slide Title SL IDE 46


Par ti ti o n s

Partition Partition
key: A key: B

Table data is stored in partitions


based on the partition key. Partition Partition
key: C key: D

Module Code & Module Title Slide Title SL IDE 47


Pa r ti ti o n i n g w i t h a s i m p l e p r i m a r y key : E x a m p l e
{
"AnimalType": "Dog", DynamoDB
<other attributes> hash function
}
Add item
{ {
"AnimalType": "Bird", "AnimalType": "Dog",
<other attributes> <other attributes>
} }
Hash function
Uses partition key
value as input. {
Output determines "AnimalType": "Turtle",
what partition to <other attributes>
put the data in }

Partition Different partition


Pets table

Module Code & Module Title Slide Title SL IDE 48


Pa r ti ti o n i n g w i t h a c o m p o s i t e p r i m a r y key:
Example
Add item
{ {
{ "AnimalType": "Dog", "AnimalType": "Turtle", "AnimalType": "Dog",
"Name": "Rover", "Name": "Ernest", "Name": "Fido",
<other attributes> <other attributes> <other attributes>
} } }

{ {
"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

Module Code & Module Title Slide Title SL IDE 49


S e c o n d a r y I n d e xe s

• Use to query data based on non-primary-key attributes


– Secondary index defines an alternate key
• Contain:
– Alternate-key attributes
– Primary-key attributes
– Optional subset of other attributes from the base table (projected attributes)
• Can be one of two types:
– Global secondary index
– Local secondary index

Module Code & Module Title Slide Title SL IDE 50


Global secondar y index example
Music Table GenreAlbumTitle Secondary Index
{
"Artist": "No One You Know", {
"SongTitle": "My Dog Spot", "Genre": "Country",
"AlbumTitle": "Hey Now", "AlbumTitle": "HezyzzNow",
"Price": 1.98, "Artist": "No One You Know",
"Genre": "Country", "SongTitle": "My Dog Spot",
"CriticRating": 8.4 }
}
{ {
"Artist": "No One You Know", "Genre": "Country",
"SongTitle": "Somewhere Down the Road", "AlbumTitle": "Somewhat Famous",
"AlbumTitle": "Somewhat Famous", "Artist": "No One You Know",
"SongTitle": "Somewhere Down the
"Genre": "Country", Road",
"CriticRating": 8.4 }
"Year": 1984
} {
"Genre": "Rock"
{ "AlbumTitle": "The Buck Starts Here",
"Artist": "The Acme Band", "Artist": "The Acme Band",
"SongTitle": "Look Out, World",
"AlbumTitle": "The Buck Starts Here", "SongTitle": "Look Out, World",
"Price": 0.99 }
"Genre": "Rock" Different partition key and sort key from the
}
keys in the table
Module Code & Module Title Slide Title SL IDE 51
Local secondary index example
Music Table ArtistAlbumTitle Local Secondary Index
{
"Artist": "No One You Know", {
"SongTitle": "My Dog Spot", "Artist": "No One You Know",
"AlbumTitle": "Hey Now", "AlbumTitle": "Hey Now",
"Price": 1.98, "SongTitle": "My Dog Spot",
"Genre": "Country", "Genre": "Country",
"CriticRating": 8.4 }
}
{
{ "Artist": "No One You Know",
"Artist": "No One You Know", "AlbumTitle": "Somewhat Famous",
"SongTitle": "Somewhere Down the Road", "SongTitle": "Somewhere Down the Road",
"AlbumTitle": "Somewhat Famous", "Genre": "Country",
"Genre": "Country", }
"CriticRating": 8.4
"Year": 1984 {
} "Artist": "The Acme Band"
"AlbumTitle": "The Buck Starts Here",
{ "SongTitle": "Look Out, World",
"Artist": "The Acme Band", "Genre": "Rock",
"SongTitle": "Look Out, World", }
"AlbumTitle": "The Buck Starts Here",
"Price": 0.99

}
"Genre": "Rock"
Same partition key as the table but
different sort key
Module Code & Module Title Slide Title SL IDE 52
Read consistency

• DynamoDB maintains multiple copies of data for durability.


– All copies of your data are usually consistent within a second after a write operation.
• Eventually consistent read might return slightly stale data if a read operation is
performed immediately after a write operation.
– Use case: Blog posts.
• Strongly consistent read returns the most up-to-date data.
– Use cases: Scoreboards, booking systems, financial algorithms.
• You can specify the preferred consistency level for reading data.

Module Code & Module Title Slide Title SL IDE 53


Tra n s a c ti o n s

• Simplify the developer experience of making coordinated, all-or-nothing changes


(inserts, deletes, or updates) to multiple items both within and across tables
• Provide atomicity, consistency, isolation, and durability (ACID), which help you
maintain data correctness in your applications
• Use cases
– Processing financial transactions
– Fulfilling and managing orders
– Building multiplayer game engines
– Coordinating actions across distributed components and services

Module Code & Module Title Slide Title SL IDE 54


P r o v i s i o n e d read/write t h r o u g h p u t

• Throughput = Maximum amount of capacity that an application can consume from


a table or index
• It is divided evenly among partitions
• Read capacity unit (RCU)
– Number of strongly consistent reads per second of items that are up to 4 KB in size
– Eventually consistent reads use half of the provisioned read capacity
• Write capacity unit (WCU)
– Number of 1-KB writes per second

Module Code & Module Title Slide Title SL IDE 55


O n - d e m a n d read/write t h r o u g h p u t

• Pay-per-request pricing for read and write requests


• DynamoDB adapts rapidly to accommodate the workload
• Request rate is limited by throughput default table limits
• Create or update a table to use on-demand mode
• Use cases
– You create new tables with unknown workloads
– You have unpredictable application traffic
– You prefer the ease of paying for only what you use

Module Code & Module Title Slide Title SL IDE 56


To p i c 3: k e y t a ke a w a y s
• Nonrelational databases:
• Horizontal scaling
• Non-traditional schema
• Components of DynamoDB:
• Table
• Items
• Attributes
• Types of primary keys:
• Simple primary key
• Composite primary
key
Module Code & Module Title Slide Title SL IDE 57
To p i c 3: k e y t a ke a w a y s
• An item has attributes.
• Different items in the same table can have a different number of attributes.
• DynamoDB stores data in partitions based on the partition key.
• With a simple primary key, the key determines which partitions are selected.
• With a composite primary key, the key still determines which partitions are
selected on the key, but the order is based on the sort key.

Module Code & Module Title Slide Title SL IDE 58


C a l c u l a ti n g R C U

• Suppose that you must read 20 items


that are 11 KB in size every second,
with eventual consistency.
• How many RCUs must you provision?
• 1 RCU = 1 strongly consistent,
or 2 eventually consistent,
reads per second for items up
to 4 KB in size

Module Code & Module Title Slide Title SL IDE 59


C a l c u l a ti n g R C U : A n s w e r

Answer: 30 RCUs

• Round 11 KB up to the next multiple of 4: 12


• Divide by 4 KB per RCU: 3
• Multiply by items read per second: 60
• Divide by 2 for eventual consistency: 30

Module Code & Module Title Slide Title SL IDE 60


C a l c u l a ti n g W C U

• Suppose that you must write 120 items


that are 7 KB in size every minute.
• How many WCUs must you provision?
• 1 WCU = 1 write per second, for items
up to 1 KB in size

Module Code & Module Title Slide Title SL IDE 61


C a l c u l a ti n g W C U : A n s w e r

Answer: 14 WCUs

• WCUs required to write each 7-KB item: 7


• Number of items per second: 2
• Multiply WCU per item by items per second: 14

Module Code & Module Title Slide Title SL IDE 62


R e v i e w Q u e s ti o n s
Case 1:
A data protection and management company that provides services to enterprises. They must provide database services for over 55
petabytes of data. They have two types of data that require a database solution. First, they need a relational database store for
configuration data. Second, they need a store for unstructured metadata to support a de-duplication service. After the data is de-
duplicated, it is stored in Amazon S3 for quick retrieval, and eventually moved to Amazon S3 Glacier for long-term storage. The
following diagram illustrates their architecture.

AWS Cloud

??? Metadata database


???
Configuratio
Corporate
data center
n
database
Amazon EC2 Amazon Simple Amazon Simple
Storage Service Storage Service
(Amazon S3) Glacier

Module Code & Module Title Slide Title SL IDE 63


R e v i e w Q u e s ti o n s
Case 2:
A commercial shipping company that uses an on-premises legacy data management system. They must migrate to a serverless
ecosystem while they continue to use their existing database system, which is based on Oracle. They are also in the process of
decomposing their highly structured relational data into semistructured data. The following diagram illustrates their architecture.

Database

???
AWS AppSync
AWS Lambda AWS Lambda

Corporate Oracle AWS Lambda


data center database Amazon Simple
Notification Service
(Amazon SNS)

Module Code & Module Title Slide Title SL IDE 64


S u m m a r y / R e c a p of M ain Po i n t s

In summary, in this chapter, you learned how to:

• Recognize different database options on AWS


• Identify the features of DynamoDB
• Describe the components of DynamoDB
• Explain how DynamoDB uses partitions
• Indicate how indexes are used with DynamoDB
• Describe how DynamoDB keeps data consistent

Module Code & Module Title Slide Title SL IDE 65


W h a t To E x p e c t N e x t W e e k

In Class Preparation for Class


• Storage Solutions in Cloud • Online research on various kind of
the storage service types in cloud.

Module Code & Module Title Slide Title SL IDE 66

You might also like