RDS + AURORA + ELASTICACHE Flashcards
What is RDS?
Relational Database Service. It works with SQL as query language
What kind of SQL databases does RDS support?
Posgres
My SQL
Aurora (AWS)
Microsoft SQL Server
MariaDB
Oracle
IBM DB2
What is Aurora
AWS’s SQL Relational Database
What are some benefits of running SQL on RDS rather than EC2 instances?
The database provisioning is automated
Automatic OS patching
continuous backups being made, which you can restore to a specific timestamp
Monitoring dashboards, to view the database’s performance
Read replicas to improve read performance
Easily setup multi-az for DR: disaster recovery
Automatic maintenance windows for minor db pgrades
You can easily scale horizontally and vertically.
Storage is backed by EBS
What is a disadvantage of running your SQL in RDS?
you can’t ssh to your RDS instances
What is storage auto scaling?
It’s for RDS. It scales automatically when it detects your database is about to run out of storage.
How does storage auto scaling work?
You set a maximum storage threshold.
It auto increases storage if:
free space less than 10%
this low storage lasts more than 5 minutes
Where can you scale your read replicas to?
Within same AZ, cross AZ, and cross Region.
How many read replicas can we create?
Up to 15
What is eventually consistent ASYNC replication? and how does it apply to RDS read replicas?
Its how the replication process works for read replicas. It means the replicas have a delay in getting the data replicated from the original Database instance. So when you read from a replica you may get old information.
What is a read replica promotion?
Read replicas can be promoted to their own database. They are out of the replication system after that. They become a separate database.
What is a connection string in SQL?
Its what tells the application where the database is, for example:
Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;
How do you connect the read replicas to the app that uses the database?
By adding connection strings in the app
What are use cases for read replicas?
When you have a production app that uses a database, and you need to add for example a reporting tool that needs to read the database.
This can slow down the production app. So what you can do instead is use a read replica for the reporting tool to read, and you dont affect the production app and the main database instance.
What are SELECT, INSERT, UPDATE, DELETE in SQL?
Types of statements you use in an app to interact with a database.
What is important in read replicas is to only interact with it with SELECT statements, which equal to read statements.
SELECT = read
insert means add, update means modify, and delete is remove. These make changes to the database, but with read replicas we only want to read them, since the changes come replicated from the original database.
What SQL statements should be used to interact with RDS read replicas?
only SELECT, which equals to read.
In AWS normally there is a cost when data goes from where to where?
From an AZ to another AZ.
From a region to another region
Or from aws to outside of aws
Does RDS read replicas have any cost for the data replicated between AZs?
No. RDS is an exception and its free. (Only within same region)
Does RDS read replicas have any cost for the data replicated between Regions?
YES.
What RDS feature is for disaster recovery?
RDS Multi-AZ
What RDS feature is for read scalability?
Read Replicas
What RDS feature is for automated storage scalability?
Storage auto scaling
How does RDS Multi-AZ work?
It creates a live or “SYNC” replica of your database in a different AZ.
This replica is in standby, and in case of AZ, network, storage, or any failure of main DB, it automatically failovers to the standby replica, which now becomes the master.
Which RDS feature uses a SYNC replica?
RDS Multi-AZ
Which RDS feature uses an ASYNC replica?
RDS Read Replicas
Can Read Replicas be set up as Multi-AZ?
Yes. A read replica can have multi-az enabled and be highly available itself. meaning the read replica will have a replica in standby.
Describe turning on Multi-AZ for an RDS database.
Just click “Modify” on the database, and enable “Multi-AZ”
Does enabling Multi-AZ on a DB imply any downtime?
NO. Zero downtime.
How does enabling Multi-AZ for an RDS DB work behind the scenes?
AWS takes a snapshot of your DB instance, and then restores it to a new standby Database. Then syncronization between both databases is enabled. (Writes to the main database are also written to the standby database).
How do you create a database in RDS? (steps)
RDS > Create Database
Select database type: Aurora, mariadb, ibm db2, oracle, etc.
Select DB version
Enter a DB aws identifier
Enter new user and password for db
Select instance type “db.t3.micro” for example.
Select storage type, size, and iops.
configure storage auto scaling
configure networking options, VPC, subnet, SG, and port for Db.
setup authentication: user/pw, iam users and roles, or kerberos.
Enable monitoring settings
Enter the database name
enable backups and its settings
enable log export to cloudwatch
enable automatic minor version upgrades and configure maintenance window for such upgrades
What is RDS Custom?
A managed, Oracle or SQL Server only database.
It grants you OS and Database customizations.
It lets you access through SSH to the underlying EC2 instance of the database
What is a recommendation to perform before making changes to your RDS Custom Database or OS?
De-activate automation mode, and take a snapshot of the database before making changes
With automation mode enabled, rds still treats the db as a managed db, but you can still access the instance.
Can you take snapshots of your database instances? If so, how does it work?
Yes. You can take an RDS Database Snapshot. This snapshot is a backup can be restored to a new database.
What OS configurations do you need to perform in your RDS database?
None. AWS does everything.
RDS automates the setup, operation and scaling of the databases.
Whats the difference between RDS and RDS Custom?
RDS is managed by AWS. With RDS Custom you can manage the OS and database through SSH and configure the database..
Which types of databases can you use with RDS Custom?
Oracle and SQL Server.
Which DBs is Aurora driver compatible with?
MySQL or Postgre. You can choose one of these 2 on creation.
Which is faster, Aurora, Postgre or MySQL?
Aurora. Aurora is cloud optimized, meaning its x5 faster than MySQL in aws and x3 Faster than Postgre in aws.
How does Aurora manage storage?
It starts at 10GB and automatically grows up ti 128TB
How is replication in Aurora better than other DBs?
Aurora’s replication is faster than other DBs, having sub 10ms replica lag.
How does Multi-AZ work with Aurora?
It doesn’t. Aurora is HA native, and failover is instantaneous.
This means that since Aurora is cloud native, you get HA by default.
What is a cost of using Aurora DB?
It’s 20% more expensive than other RDSs, but it’s more efficient.
How does Aurora store its data?
It makes 6 copies of all the data across 3 AZs.
The database has one shared logical volume spread across volumes in the 3 AZs.
Each time data is written, it goes to the 3 AZs, to 2 different physical volumes per AZ.
But it’s not the same 2 volumes in each AZ. Each write goes to 2 different volumes in each AZ, meaning the whole database is spread across hundreds (100s) of volumes.
What happens to Aurora if 1 AZ goes down?
It can still operate normally with 2 AZs
What are the main features of Aurora Storage?
It does replication of data across 3 AZs in the region. To 100s of volumes.
It does constant self healing of the data with peer to peer replication, to keep 6 copies of it across the 3 AZs.
It automatically expands storage with use.
All of this is by default.
How many copies of data do you need for writes and reads in Aurora?
You need 4 copies for writes, and 3 copies for reads. This for every piece of data.
How do read replicas work in Aurora?
In aurora, you have 1 master instance that makes writes to the storage, and up to 15 reader instances that take reads from the storage.
A reader instance can become the master in under 30 seconds if the master fails.
What is the writer endpoint in Aurora?
It’s a DNS name that always points to the master, even if the master failovers to a reader instance
What is Aurora Auto Scaling?
It’s the automated scaling of the number of reader instances depending of the need of the database. This feature of aurora is combined with the use of a Reader Endpoint.
What is a Reader Endpoint in Aurora?
Since we use many reader instances, and auto scaling. For the app to be able to connect to these automatically created/deleted reader instances, it uses the Reader Endpoint. Now the app only needs to connect to the reader endpoint, and it connects the app to one of the reader instances.
It’s basically a load balancer at the connection level between the app and the reader instances.
How do you increase storage in Aurora?
You don’t. Storage Auto expands between 10GB and 128TB.
What is Backtrack?
An Aurora feature and technology, that lets you restore your database to any point in time, without the use of backups.