Databases Flashcards
1
Q
What is a relational database and the types available on AWS?
A
Relational database is a database with tables, and each table has rows and columns
- On AWS, you can use SQL Server, Oracle, MySQL Server, Amazon Aurora, MariaDB
2
Q
Two key features of Relational Database Services (RDSs) on AWS
A
- Multi AZ: RDSs on AWS have their own DNS addresses, which point you to your database. If the region goes down where that DB is, they will automatically reroute that DNS to the backed up version of the DB in another region
- Read replicas: every time we write to a DB, it is replicated in a Read Replica DB. If the original DB goes down, we have to reroute traffic to the Read Replica DB manually through a new DNS
3
Q
Non-relational Databases
A
- Collection (a table)
- Inside the collection, we have Documents (a row)
- Key-value pairs (fields/columns)
- You can add new key-value pairs that won’t create null data as would create a new column in a RDS for one row
4
Q
Data Warehousing
A
- Used for business intelligence. E.g. Cognos, Jaspersoft, SQL Server
- Used to pull in very large and complex data sets. Usually used by management to do queries on data
- Data Warehousing databases use different types of architecture, both from a database perspective and infrastructure layer. AWS’s answer to Online Analytics Processing (OLAP) is Redshift
5
Q
ElastiCache
A
- Web service that makes it easy to deploy, operate, and scale an in-memory cache in the cloud
- Improves the performance of web applications by allowing you to retrieve information from fast, managed, in-memory caches, instead of relying entirely on slower disk-based databases
- E.g. cache most common web queries, instead of pulling from the DB each time. Takes a huge load off databases
- ElastiCache supports two, open-source in-memory caching engines: Memcached and Redis
6
Q
AWS RDS (general)
A
- RDS runs on virtual machines (but you don’t have access to these VMs, you cannot SSH in)
- Patching of the RDS OS and DB is Amazon’s responsibility
- RDS is NOT serverless (except for Aurora)
- Used for Online Transaction Processing (OLTP)
7
Q
RDS Back-ups
A
- Automated backups: recover the DB to any point in time within a “retention period” (1 to 35 days). Point-in-time recovery down to the second within the retention period.
- Enabled by default
- Stored on S3 for free
- Backups taken in a defined window - Database snapshots: done manually and stored even after you delete the original RDS instance
Restoring backups:
- For both automated and snapshots, the restored version will be a new RDS instance with a new DNS endpoint
8
Q
RDS encryption
A
- Available for all RDS types
- Done with KMS
- Once your RDS is encrypted, the data stored at rest in the underlying storage is encrypted, as are its automated backups, read replicas and snapshots
9
Q
RDS Multi-AZ
A
- Allows you to have an exact copy of your production DB in another AZ.
- Handled by AWS, synchronised to a standby database
- In the event of DB maintenance, instance failure or AZ failure, RDS will automatically failover to the standby
- Multi-AZ is for disaster recover only
- Available for all 6 DBs except Aurora, which in itself is fault tolerent
10
Q
RDS Read Replica
A
- Allows a read-only copy of your production DB. Asynchronous replication from the primary RDS instance to the read replica
- Available for all 6 DB types
- Used for scaling (not DR)
- Can have up to 5 read replicas of any DB
- Each read replica can have its own DNS endpoint
- Can be multi-az
- Can be promoted to their own DB
11
Q
DynamoDB
A
- NoSQL DB service for applications that need consistent, single-digit millisecond latency at any scale
- Supports both document and key-value data models
- Great for mobile, web, gaming, ad-tech, IoT etc
- Basics:
- Stored on SSD (hence its speed)
- Spread across 3 geographical data centres
- Eventual consistent reads (default, consistency across all copies of the data within a second)
- Strongly consistent reads (if you need reads faster than 1 second)
12
Q
DynamoDB Accelerator (DAX)
A
- Highly available, in-memory cache
- Caching service that sits between your applications and DynamoDB
- 10x performance improvement
- Reduces request time from milliseconds to microseconds - even under load
- No need for developers to manage caching logic
- Compatible with DynamoDB API calls
13
Q
DynamoDB Transactions
A
- Multiple “all-or-nothing” operations
- E.g. financial operations, fulfilling orders, addition and subtraction at the same time
- Two underlying reads or writes - prepare/commit
- Can carry out 25 items or 4MB of data at one time
14
Q
DynamoDB on-demand capacity
A
- Pay-per-request pricing
- Balances cost and performance automatically
- No minimum capacity
No charge for read/write - only storage and backups - But you pay more per request than provisioned capacity, therefore best for scenarios such as product launches
15
Q
DynamoDB backup and restore
A
- Full backups at any time
- Zero impact on table performance or availability (unlike backups of traditional RDSs)
- Consistent within seconds and retained until deleted
- Operates within same region as the source table