RDS + Aurora + Elasticache Flashcards
RDS
Relational Database Service
Managed DB Service that uses SQL as a query language
RDS Storage AUto Scaling
Detects when you run out of free database storage, scales automatically
You have to set Maximum Storage Threshold
Useful for applications with unpredictable workloads.
RDS Read Replicas
Application performs reads and writes to Database instance, which sends read data to application.
Up to 15 read replicas
within AZ, cross AZ or cross Region.
Replication is asynchronous so reads are eventually consistent.
Replicas can be promoted to their own DB
Application must update the connection string to leverage read replicas.
Use Case: you have production database taking on normal load, but you want to run a reporting application. you create read replica to run the new workload there.
RDS Read Replicas- Network Cost
RDS read replicas within same region, you don’t pay that replication fee.
RDS
Multi AZ
For disaster recovery
Does not require you to change the SQL connection string
Sync Replication
One DNS name- automatic app failover to standby
Increases availability
Failover in case of loss of AZ, loss of network, instance or storage failure.
Not used for scaling.
Read replicas can be setup as Multi AZ for disaster recovery.
RDS from single-az to multi-az
zero downtime operation ( no need to stop DB)
just click on “modify” for the database and enable multi-AZ.
Amazon Aurora
Aurora is a proprietary technology from AWS (not opened source)
POstgres and MySql are both supported Aurora DB ( that means your drivers will work as if Aurora was a Postgres or MySql Database)
Aurora is “AWS cloud optimized” and claims 5x performance improvement over MySql on RDS, over 3x performance of Postgres on RDS
Aurora storage automatically grows in increments of 10GB up to 128 TB
Aurora can have up to 15 read replicas and the replication process is faster than MySQL
Failover in Aurora in instantaneous.
Auora costs more than RDS (20% more) but is more efficient.
Aurora High Availability and Read Scaling
6 copies of your data across 3 AZs
Shared Storage Volume: replication + self healing + auto expanding
It’s like multi-AZ for RDS. one instance takes writes (master)
automated failover for master in less than 30 seconds
Master + up to 15 aurora read replicas serve reads
Supports cross region replication
Aurora DB Cluster
Client talks to writer endpoint and redirected to right instance.
Then there is multiple read replicas. there is autoscaling. storage volume auto expands.
reader endpoint helps with connection load balancing and connects with all the multiple read replicas.
Load balancing happens at connection level not statement level.
Writer Endpoint
Cluster endpoint (or writer endpoint) for a DB cluster connects to the current primary DB instance for that DB cluster. Cluster endpoint is the only one that can perform write operations such as DDL statements as well as read operations.
Reader Endpoint
A reader endpoint for an Aurora DB cluster provides connection-balancing support for read-only connections to the DB cluster. Use the reader endpoint for read operations, such as queries. By processing those statements on the read-only Aurora Replicas, this endpoint reduces the overhead on the primary instance.
Custom Endpoints
A custom endpoint for an Aurora cluster represents a set of DB instances that you choose. When you connect to the endpoint, Aurora performs connection balancing and chooses one of the instances in the group to handle the connection. You define which instances this endpoint refers to, and you decide what purpose the endpoint serves.
use case: aurora instances with higher computing power, so you would want to query them for higher workloads.
Aurora Serverless
Automated Database instantiation and auto-scaling based on actual usage
good for infrequent, intermittent or unpredictable workloads.
no capacity planning needed
pay per second, can be more cost- effective
Global Aurora
Aurora Cross region read replicas
aurora global database (recommended): 1 primary region for (Read/write). up to 5 secondary (read only) regions, replication lag is less than 1 second. up to 16 read replicas per secondary region.
Typical cross-region replication takes less than 1 second.
You would like to ensure you have a replica of your database available in another AWS Region if a disaster happens to your main AWS Region. Which database do you recommend to implement this easily? use Aurora Global Database