AWS - 8. Databases

Tony Lee·2023년 5월 25일
0

knowledge

목록 보기
15/16
post-thumbnail

Database Types in AWS

NameDB TypeFeatures
RDSSQLTransactional
AuroraSQLTransactional
RedshiftSQLData Warehouse
DynamoDBKey/ValueSmall Values
KeySpacesKey/ValueLarge Values
NeptuneGraph
DocumentDBDocumentsXML, JSON, compatible with MongoDB
TimestreamTime Series
ElasticacheIn-memory

RDS

AZ scoped platform-as-a-service that can be simplified as running on top of EC2 with EBS volumes

Features

Failover

If your DB becomes unavailable in RDS, AWS will replace it automatically with another resources that has a current copy of the data.

This is very useful for production cases because this entire process will happen within less than 60 seconds of total outage time.

Backups

Automated Backup
Up to 35 day retention and contains db as long as transaction logs and it will create a new db

Manual Snapshot
Kept until deleted and can be shared with remote accounts unlike automated backup. Snapshots can be encrypted.

Export to S3
It does not require a new db instance

Scaling

RDS Read Replicas
Asynchronous replicas in the same region or remote region

Security

RDS is launched into a VPC, so it will inherit the VPC security features such as, network ACLs, route tables, and security groups.

Deploy RDS in Console

Scenario: Deploying a test RDS

  1. Before creating the RDS db, create a subnet group, because all RDS instances have to be associated with a subnet group
  2. You don't have the option to provision a subnet group during the creation of RDS
  3. Create a subnet group, associate with your desired VPC
  4. Select your AZ
  5. Select your subnets
  6. Click Create DB
  7. Go with standard create
  8. Pick an Engine
  9. Production automatically puts RDS in multi-AZ
  10. Free-tier is just a single instance
  11. Leave defaults
  12. Choose AZ for the subnet
  13. Choose password and IAM auth
  14. Create DB

Deploy RDS in CLI

Scenario: Modify Role to enable enhanced monitoring for multiple RDS

  1. Create a script file rds_enable_enhanced_monitoring.sh
#!/bin/bash

REGION=$1
DBNAME=$2
ROLEARN=$3

aws rds moify-db-instancen --region $REGION \
--db-instance-identified $DBNAME \
--monitoring-inverval 60 \
--monitoring-role-arn $ROLEARN
  1. Run the script file
    $ bash ./rds_enable_enhanced_monitoring.sh YOUR_REGION YOUR_RDS YOUR_ARN

  2. Reload console to see if the configurations are changing

DynamoDB

Region Scoped serverless Key/Value Database

Basics

When you write data, it is spread across multiple AZs so if one AZ completely fails, it is still possible to fully function.

Features

  • ACID support
  • GSI/LSI
  • DAX

Deploy DynamoDB in Console

  1. Click Create Table
  2. Partition Key is almost like a primary key
  3. Partition Key is best to have a large cardinality
  4. Use something like username
  5. Leave defaults
  6. Create Table

Disclaimer

This summary is made possible by Oreilly's AWS, 3rd Edition - Chad Smith.
If the above post violates any copyright permissions, please let me know!

profile
Striving to have a positive impact on the community

0개의 댓글