RELATIONAL DATABASE SERVICE (RDS)

Database Refresher & MODELS - PART1 (8:51), PART2 (14:45)

Alt text SQL vs NoSQL

what is sql?

what is nosql?

Relational (SQL) Database

Alt text Relational Database, e.g. MySQL, Postgres

Non-Relational (NoSQL) Database

Alt text Key-Value Database, e.g. Redis, Google Bigtable, Amazon DynamoDB

Alt text Wide Column Store, e.g. Google Bigtable, Amazon DynamoDB

Alt text Document Database, e.g. MongoDB, Amazon DocumentDB

Alt text Column Database, e.g. BigQuery, Amazon Redshift

Alt text Graph Database, e.g. neo4j, Amazon Neptune

ACID vs BASE (11:02)

Alt text CAP Theorem

what is cap theorem?

The CAP theorem states that any networked shared-data system can have at most two of three desirable properties:

  • consistency (C) equivalent to having a single up-to-date copy of the data (linearizable);
  • high availability (A) of that data (system always accepts updates);
  • and tolerance to network partitions (P)

Ref:

Alt text ACID

Alt text BASE

Databases on EC2 (13:08)

Alt text Why?

Alt text Why not?

Alt text Databases on EC2 - Example

[DEMO] Splitting Wordpress Monolith => APP & DB (18:01)

Relational Database Service (RDS) Architecture (11:39)

Alt text RDS - DBSaaS

Alt text RDS - Architecture

Alt text RDS - Costs

[DEMO] Migrating EC2 DB into RDS - PART1 (18:20)

Alt text

Alt text

[DEMO] Migrating EC2 DB into RDS - PART2 (12:58)

Relational Database Service (RDS) MultiAZ - Instance and Cluster (11:54)

Alt text RDS - Multi AZ - Instance

Alt text RDS - Multi AZ - Instance - Failover

Alt text RDS - Multi AZ - Instance - Summary

Alt text RDS - Multi AZ - Cluster - Architecture

Alt text RDS - Multi AZ - Cluster - Summary

compare rds multi az instance and multi az cluster.

  • Multi AZ Instance:

    • 1 Primary instance
    • 1 Standby replica:
      • can’t be used for reads / write 👈 not for performance scaling, only for availability
      • kept in sync Synchronously with the primary instance
  • Multi AZ Cluster:

    • 1 Writer DB instance
    • 2 Reader DB instances:
      • can be used for read 👈 limited read scaling
      • kept in sync Asynchronously with the Writer instance 👈 replication lag (aka Replica lag)

RDS Automatic Backup, RDS Snapshots and Restore (8:52)

Alt text RDS Backups - General

what kind of backups does rds support?

RDS support 2 kind of backup:

  • Manually Snapshots
  • Automated Backups

what is rds manually snapshot?

A backup performed manually and live past the termination of an RDS instance

what is rds automated backups?

Backups performed automatically by RDS:

  • 0 to 35 days retention.
  • RDS also use S3 to store transaction logs every 5 minutes.

👉 With RDS Automated Backups, RPO can be only 5 minutes. 💪

Alt text RDS Backups - Cross-Region

Alt text RDS Restores

where is a rds snapshot restored to?

RDS Snapshot is restored to a new RDS instance, with new address.

how long is an rds restore?

RDS Restores aren’t fast. Be careful with RTO.

RDS Read-Replicas (6:36)

Alt text RDS Read-Replicas are kept in sync asynchronously with the primary instance

Alt text RDS Read-Replicas - Performance Improvement

Alt text RDS Read-Replicas - RPO/RTO Improvement

what is the impact of rds read-replicas to rpo/rto?

Read-Replicas offer:

  • near 0 RPO.
  • very low RTO 👈 RRs can be promoted quickly.

can read-replicas solve data corruption?

No. Data corruption will be replicated to RRs.

[DEMO] MultiAZ & Snapshot Restore with RDS - PART1 (14:05)

[DEMO] MultiAZ & Snapshot Restore with RDS - PART2 (12:07)

RDS Data Security (7:03)

Alt text RDS Data Security

Alt text RDS Data Security - Extra Security

Alt text RDS KMS Encryption & TDE

Alt text IAM Authentication RDS

RDS Custom (5:22)

Alt text RDS Custom - Fill the gap between DB-on-EC2 and RDS.

Alt text RDS Custom - Shared Responsibility

Aurora Architecture (13:44)

Alt text Aurora - Key Differences

Alt text Aurora - Storage Architecture - 6 replicas

Alt text Aurora - Storage Architecture - Summary

Alt text Aurora - Endpoints

Alt text Aurora - Cost

Alt text Aurora - Restore, Clone & Backtrack

👉 Aurora implements a number of radical design changes which offer significant performance and feature improvements over other RDS database engines.

Aurora Serverless (9:52)

Alt text Aurora Serverless - Concepts

Alt text Aurora Serverless - Architecture

Alt text Aurora Serverless - Use Cases

[DEMO] Migrating to Aurora Serverless [DENT DO THIS DEMO, IT WON’T WORK, UPDATING to SERVERLESSv2] (14:47)

Aurora Global Database (5:08)

Alt text Aurora Global Database - Architecture

how long is aurora global database's replication between regions?

Less than or equal 1s

Alt text Aurora Global Database - 5 secondary regions - each regions can have 16 read-only replicas

Aurora Multi-master writes (7:51)

Alt text Aurora Multi-Master - All instances are R/W

Alt text Aurora Multi-Master - Architecture

Alt text Aurora Single-Master - Failover

Alt text Aurora Multi-Master - Failover

Relational Database Service (RDS) - RDS Proxy (9:47)

Alt text RDS Proxy - Why?

why use rds proxy?

  • Opening/Closing DB Connections consume resources.

    • Increase latency.
    • Especially with serverless architecture.
  • Handling failure of DB instance is hard:

    • Doing it within application add risks

👉 RDS Proxy solves these problems.

how rds proxy works?

Alt text

Amazon RDS Proxy:

  • sits between your application and your relational database
  • to efficiently manage connections to the database

👉 improve scalability of the application.

Alt text RDS Proxy - Architecture

Alt text RDS Proxy - When?

Alt text RDS Proxy - Key Facts

Database Migration Service (DMS) (11:03)

Alt text Database Migration Service (DMS) - Summary

can dms be used for on-premises db?

Yes and No.

  • DMS can be used to migrate from/to on-premises DB if the other endpoint were on AWS.
  • If both endpoints are on-premise, DMS can NOT be used.

Alt text DMS - Architecture

where is dms run?

On a replication instance (an EC2 instance).

which part of dms really run the migration?

DMS Task:

  • Full load
  • Full load + CDC
  • CDC only

Alt text Schema Conversion Tool (SCT)

aws schema conversion tool (sct) vs aws dms schema conversion?

  • AWS Schema Conversion Tool (SCT):

    • convert your existing database schema from one database engine to another.
    • used to convert data warehouse schemas, big data frameworks, application SQL code, and ETL processes.
  • AWS DMS Schema Conversion:

    • a web-version of the AWS SCT. [1]
    • supports less database platforms and provides more limited functionality compared

Alt text DMS & Snowball ☃️

RDS Section Quiz