Amazon Database
|
October 28, 2017
|
Development,
AWS
Database and AWS
Categories- Relational
- NoSQL
- Online Transaction Processing OLTP, frequent writing
- Online Analytic Processing OLAP, data warehouse
- MySQL
- Oracle
- PostrgreSQL
- Microsoft SQL Server
- MariaDB
- Amazon Aurora
Data Warehouses – Amazon Redshift
central repository for data from many sources- OLAP
- Batch jobs
NoSQL Amazon DynamoDB
- allows for horizontal scalability
- non-relational
- do not have same table and columns as relational
- Key/Value store or document stores
- used for managing
- user session state
- user profiles
- shopping cart
- time series database
- setup
- operations
- scaling
- backups
- patching
- scaling
- replication
DB Parameter group
a container for engine config values to be applied to one or more DB instancesDB Options
a container for engine features, ex: Oracle statspackOperations Benefits
- reliability
- simplify common tasks
Database Engines
MySQL
support Multi-AZ deployment for HA and Read Replicas for horizontal scalingPostgreSQL
support Multi-AZ deployment for HA and Read Replicas for horizontal scalingMariaDB
support Multi-AZ deployment for HA and Read Replicas for horizontal scalingOracle
editions- Standard Edition One
- Standard Edition
- Enterprise Edition
Microsoft SQL Server
editions- Express Edition
- Web Edition
- Standard Edition
- Enterprise Edition
Licensing
Oracle and Microsoft SQL server- License include
- AWS holds licenses
- included in price
- Oracle – Standard Edition One
- Microsoft – Express, Web, Standard
Amazon Aurora
5 times the performance of MySQL Creates a DB cluster that has one or more instances and a cluster volume. Cluster Volume is a virtual database storage volume spanning multiple AZs. Primary Instance is the main instance that supports both read and write Amazon Aurora Replicas are secondary instances that supports read operations each DB cluster can have up to 15 Amazon Aurora Replicas in addition to primary instances. Can Locate Replicas in multiple AZs Storage Options- users EBS
- 4 to 6 TB
- up to 30,000 IOPS
Backup and Recovery
Automated backups
tracks change sand backs up DB creates storage volume snapshot. Backup Retention Period- Default: retains 1 day of backups
- Max: 35 days of backups
Manual Backups
manually initiated and snapshots are kept until explicitly deletedRecovery
when restored and only default Security Group and DB parameter is set, After completing recovery you must reset Security Group and custom DB parametersHigh Availability with Multi-AZ
allows you to crate a dB cluster across Multiple AZs. Lets you meet:- RPO – recover point objective
- max period of data loss that is acceptable
- RTO – recovery time objective
- max amount of downtime that is permitted to recover from backup
- loss of primary AZ
- loss of network connectivity to primary
- compute unit failure on primary
- storage failure on primary
Scale up and out
when going up in compute, memory or storage, changes are scheduled during next maintenance or immediately using ModifyDBInstance Horizontal Scalability with Partitioning partitioning or sharding allows horizontal scaling NoSQL are designed to scale horizontally Horizontal Scalability with Read Replicas- heavy read workloads
- offload reporting
Security
- use IAM Policies
- Private Subnets
- ACL
- Security Groups
- SSL
Amazon Redshift
- petabyte scale data warehouse
- relational DB for OLAP
- uses PostgreSQL
Clusters and Nodes
key component of Redshift is a cluster cluster- Leader node
- one or more compute nodes
Dense Compute
up to 32 TB using fast SSDsDense Storage
up to 2 PB using magnetic disks Increase query performance by adding compute nodes Resize Operation on Redshift- creates new cluster
- DB becomes read only until finished
- Even: default
- Key: distributed based on values in one column
- All: full copy of table distributed to every node
- compound: more efficient when using prefixes
- interleaved: equal weight to each column
- standard insert and update
- bulk uses Copy
- Unload for exporting
- Workload Management (WLM): queues and prioritized queries
- automatically stored internally on S3 but can do manual snapshots
Amazon DynamoDB
NoSQL – fast, low latency must define a certain read or write capacity and Amazon DynamoDB auto adds capacity to support it- on fast SSDs
- requires tables have a primary key
- stores info as key/value pair
Supports 5 Scalar Data Types
- String
- Number
- Binary
- Boolean
- Null
Set Data Types
unique list of one or more scalar types- String
- Number
- Binary
Document Data Types
represents multiple nested attributes- List: ordered list
- Map: unordered list
Partition and Sort key
- primary key is mad of two attributes
- first attribute is partition key
- second attribute is sort (or range) key
- Global
- Local
Searching
- Query: primary search operation that requires a partition key attribute name and a distinct value
- Scan: reads every time in table
