Chapter 8 - Databases Flashcards
RDS databases (Amazon Relational Database Solution)
- RDS database types come in SQL server, Oracle, MySQL,PostgreSQL, MariaDB, and Amazon Aurora.
- RDS is for online transaction processing workloads.
- So, this is where you are basically processing lots of small transactions like customer orders, banking transactions, payments, and booking systems.
Redshift
- For data warehousing
- OLAP (online analytical processing) tasks like analyzing large amounts of data reporting and sales forecasting.
Read Replicas
- This is where you’re scaling your read performance.
- It’s primarily used for scaling
- Not for disaster recovery.
- It requires automatic backups to be turned on.
- So, if you can’t for some reason create a Read Replica of your primary database,it just means you haven’t turned on automatic backups.
- Multiple Read Replicas are supported.
- So, you can have up to 5 Read Replicas per MySQL, MariaDB, PostgreSQL, Oracle, and SQL server.
- Read Replicas read-only copy of your primary database in the same availability zone,
- cross availability zones or across regions is available.
- And of course you use this to increase or scale your read performance.
- It’s great for read heavy workloads and it takes the load off your primary database for read-only workloads.
Aurora
- Amazon’s proprietary database that’s something that they have created themselves
- It’s compatible with MySQL, as well as PostgreSQL.
- It always has 2 copies of your data in each availability zone with a minimum of 3 availability zones.
- So, you always have 6 copies of your data.
- So it’s very, very redundant.
- You can also share Aurora snapshots with other AWS accounts
You have 3 types of replicas available with Aurora.
- You’ve got a Aurora replicas themselves,
- You can also create MySQL replicas,
- And PostgreSQL replicas.
- An automated failover is actually only available when you have Aurora replicas.
- Aurora has automated backups turned on by default.
- You can also take snapshots with Auroras
- You can share these snapshots with other AWS accounts.
DynamoDB
- it’s stored on SSD storage
- it’s spread across 3 geographically distinct data centers
- You can have eventually consistent reads which is what you get by default,
- You can also have strongly consistent reads.
DynamoDB transactions
- This is where you have multiple all-or-nothing operations.
- So, it’s good for things like financial transactions or fulfilling orders.
You have 3 options for your reads
- Eventual consistency,
- Strong consistency and then
- Transactional consistency
You have 2 options for your writes
- Standard
- transactional
- You can have 25 items using DynamoDB transactions or 4 MB of data.
ACID requirements
DynamoDB transactions provides developers
- atomicity
- consistency
- isolation,
- durability across one or more tables within a AWS account or AWS region.
If you see something about ACID requirements with DynamoDB, you need to use DynamoDB transactions.
This is basically means, you’ve got all-or-nothing transactions.
DynamoDB On-Demand backups and restore
- This is where you can backup your DynamoDB database with full backups at any time.
- It has zero impact on your table performance or availability.
- And you have consistent within seconds
- And your backups are retained until deleted.
- And it operates within the same region as the source tables.
- When you’re creating a DynamoDB backup, it will be in the same region as the source table.
DynamoDB Point-in-Time Recovery
- It protects against accidental writes or deletes
- You can restore your DynamoDB database to any point in the last 35 days
- The backups are incremental.
- It’s not enabled by default.
- However, you will have to go and turn it on.
- And the last restorable rate is going to be 5 minutes in the past.
DynamoDB streams
this is where you can maintain first in first out records of your data.
So as you go and add transactions -
- basically it’s given a sequence number.
- These sequences are stored in a stream,
- and the data’s broken up into shards.
- Every shard is stored for 24 hours
- and your stream records are going to consist of things like inserts, updates, and deletes.
- And you can combine this with a Lambda function to add functionality like stored procedures.
So, it’s just time audit sequences of item level changes in a table.
global tables
- this is where you have managed Multi-Master, Multi-Region Replication.
- It is designed where you’ve got applications that are globally distributed.
- You need to have DynamoDB streams turned on.
- So, it’s based off DynamoDB streams.
- Basically allows you to have Multi-region redundancy for disaster recovery or high availability.
- And you don’t have to rewrite their application.
- This is all built in functionality within DynamoDB.
- And your application latency typically will be under one second.
And the key thing here is to remember
- if they’re talking about if you want to add redundancy to DynamoDB,you need to turn on global tables.
- If global tables isn’t turning on, you need to make sure that you’ve enabled DynamoDB streams.