Module 8 - Databases
Module 8 - Databases
Unmanaged: Managed:
Scaling, fault tolerance, and Scaling, fault tolerance, and
availability are managed by availability are typically built in
you. to the service.
6
Challenges of relational databases
• Server maintenance and energy footprint
• Software installation and patches
• Database backups and high availability
• Limits on scalability
• Data security
7
AWS Cloud
Users Application
Servers Amazon RDS
From on-premises databases to Amazon RDS
Database in Amazon Elastic Database in Amazon RDS or
On-premises database
Compute Cloud (Amazon EC2) Amazon Aurora
AWS manages:
• OS installation and patches
• Database software installation and patches
• Database backups
• High availability
• Scal ing Amazon RDS
• Power and racking and stacking servers
• Server maintenance
Amazon RDS DB instances
Amazon RDS =
MyS QL
Amazon Aurora
DB Instance Class
• CPU
• Mem or y Microsoft SQL Server
M • Network performance
DB Instance Storage
PostgreSQL
Amazon RDS DB
main instance MariaDB
• Magnetic
• General Purpose (solid state drive, or SSD)
• Provisioned IOPS Oracle
DB engines
Amazon RDS in a virtual private cloud (VPC)
AWS Cloud
Availability Zone
VPC
Public subnet
12
Internet
Users gateway Amazon EC2
Private subnet
Amazon RDS
High availability with Multi-AZ deployment
AWS Cloud
Availability Zone 1 Availability Zone 2
VPC
Public subnet
M Synchronous S
Amazon RDS
RDS Standby
instance
instance
High availability with Multi-AZ deployment 2
AWS Cloud
Availability Zone 1 Availability Zone 2
VPC
Public subnet
M Synchronous S
Amazon RDS
RDS Standby
instance
instance
Amazon RDS read replicas
AWS Cloud
Features Availability Zone
•Offers asynchronous replication VPC
Public subnet
•Can be promoted to master if needed
workloads
M R
•Offload read queries Amazon RDS Read Replica
instance
instance
Use cases
High throughput
Web and mobile applications Massive storage scalability
High availability
16
Low-cost database
Ecommerce applications
Data security
Fully managed solution
Rapidly grow capacity
Mobile and online games Automatic scaling
Database monitoring
When to Use Amazon RDS
UseAmazon RDS when your application Do not useAmazon RDS when your
requires: application requires:
• Complex transactions or complex • Massive read/write rates (for example,
queries 150,000 write/second)
• A medium to high query or write rate – • Sharding due to high data size or
Up to 30,000 IOPS (15,000 reads + throughput demands
15,000 writes) • Simple GET or PUT requests and
• No more than a single worker node or queries that a NoSQL database can
shard handle
• High durability • Relational database management
system (RDBMS) customization
Amazon RDS: Clock-hour billing and database characteristics
Clock-hour billing –
Database characteristics –
• Physical capacity of database:
• Engine
• Size
• Memory class
Amazon RDS: DB purchase type and multiple DB instances
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 19
Number of DB instances –
• Provision multiple DB instances to handle peak loads
Amazon 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
Amazon RDS: Deployment type and data transfer
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 21
Data transfer –
• No charge for inbound data transfer
• Tiered charges for outbound data transfer
Section 2: Amazon DynamoDB
Relational versus non-relational databases
Relational (SQL) Non-Relational
Data Storage Rowsand columns Key-value, document, graph
Schemas Fixed Dynamic Focuses on
collection of
Querying Uses SQL documents
Scalability Vertical Horizontal
• Low-latency queries
• DynamoDB supports two different kinds of primary keys: Partition key and
partition and sort key
© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved. 34
Partitioning
35
© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Items in a table must have a key
Section 3: Amazon Redshift
41
Amazon Redshift
Introduction to Amazon Redshift
© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved. 42
Parallel processing architecture
Amazon Redshift
Leader node
Dense compute
node Dense compute nodes
• Virtual Core
• RAM
• Local disk
Amazon DynamoDB
Amazon S3
43
Automation and scaling
Manage
Monitor
Scale
44
Compatibility
45
Amazon Redshift use cases
• Enterprise data warehouse (EDW)
• Migrate at a pace that customers are comfortable with
• Experiment without large upfront cost or commitment
46
52
Resilient design
53