Databases Flashcards

(99 cards)

1
Q

Relational Databases

A

are like excel spreadsheet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

RDS OLTP on AWS

A
  1. SQL Server
  2. Oracle
  3. MySQL Server
  4. PostgreSQL
  5. Aurora and
  6. MariaDB
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

RDS has 2 key features

A

Multi-AZ and Read Replicas

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Multi AZ is meant for

A

Disaster Recovery

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Read Replicas meant for

A

Performance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Difference between Multi AZ and Read Replicas

A
  1. Multi AZ - we use a connection string (dns) from our Ec2 instance to the primary DB. If for some reason we lost the primary database, amazon will detect that and will automatically update the DNS to point to the secondary databse - You don’t need to go in and change any IP address; fail over is automatic
  2. Read Replicas - Every time you do a write to that database, that write is going to be replicated (5 copies) to another database; no automatic fail over; if your primary DB fails, you have to manually change the Ip address from your EC2 to the replica DB
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When is Read Replica useful?

A

if your primary database is getting way too many reads, you can scale it by having the read replica (5 COPIES); have some of your ec2 instances point to the read replica and point the other half to your primary database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Non Relational database

A

Collection = Table
Document = Row
Key Value Pairs = Fields

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Difference between Relational Databases and Non relational?

A

For non relational DB, you can have as many columns as you want but for Relational DB, if you add column for one record, that needs to be updated for all the other records

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is Data Warehousing?

A
  1. Used for BI (Cognos, Jaspersoft, SQL Server Reporting Services, Oracle Hyperion, SAP NetWeaver)
  2. Used to pull in very large and complex datasets (performance/targets)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does OLTP differ from OLAP?

A

in terms of the queries that you will run

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Amazon Data Warehouse solution

A

Amazon RedShift

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Elasticache

Example:

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
top 10 queries in amazon

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Elasticache supports 2 open source in memory caching engines:

A

Memcached and Redis

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

2 types of RDS Backups

A
  1. Automated Backups

2. Database Snapshots

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Read Replicas

A
  1. Can be multi-AZ
  2. Used to increase performance
  3. Must have backups turned on
  4. Can be in different regions
  5. Can be aurora or MySQL
  6. Can be promoted to master (this will break the read replica)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

MultiAZ

A
  1. Used for DR

2. You can force a failover from one AZ to another by rebooting the RDS instance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Encryption at Rest is supported for which databases?

A

Mysql, Oracle, SQL Server, PostgreSQL, MariaDB and Aurora

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

How is encryption at rest done

A

using AWS KMS; once your RDS instance is encrypted, the data stored at rest in the underlying storage is encrypted, as are its automated backups, read replicas and snapshots

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Redshift is used for

A
  1. Business Intelligence

2. Data warehousing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

RDS runs on

A

Virtual Machines

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Can you log in to the OS of the RDS?

A

no

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Who is responsible for patching the RDS OS and DB?

A

Amazon

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

RDS is not serverless - true or false

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Aurora Serverless is Serverless - true or false
true
26
Initiating an RDS instance in comparison to EC2 instance
RDS takes longer to initiate compared to Ec2
27
Read replicas are used for
scaling not DR
28
Pre requisite before turning on read replica
automatic backups need to be turned on
29
of Copies for read replicas
5
30
You can have read replicas of read replicas
true (but could have latency issues)
31
Each read replica will have its own DNS end point
true
32
You can have a read replica in a second region
true
33
Amazon DynamoDB
fast and flexible NoSQL database service for all applications that need consistent, single digit millisecond latency at any scale
34
DynamoDB is a fully managed database and supports both
1. Document | 2. Key-value data models
35
DynamoDB is a great fit for
mobile, web, gaming, ad-tech, IOT etc
36
Basics of DynamoDB:
1. Stored on SSD storage 2. Spread across 3 geographically distinct data centers 3. Has 2 types of read: > eventual consistent reads and > strongly consistent reads
37
Eventual Consistent reads
consistency across all copies of data is usually reached within a second (best read performance)
38
Strongly Consistent reads
returns a result that reflects all writes that received a successful response prior to the read (less than a second)
39
Amazon Redshift
fast and poweful, fully managed, petabyte scale data warehouse service in the cloud
40
OLAP vs OLTP
OLAP pulls in a large number of records while OLTP is usually just a query for a specific record
41
Redshift can be configured:
1. Single Node (160GB) | 2. Multi-Node
42
Redshift Multi-Node has
1. Leader node - manages client connections and receives queries 2. Compute node - store data and perform queries and computations (up to 128 compute nodes)
43
Redshift Advanced Compression
1. Columnar data stores can be compressed much more than row-based data stores because similar data is stored sequentially on disk. 2. Employs multiple compression techniques and can often achieve significant compression relative to traditional relational data stores. 3. Doesn't require indexes or materialized views so uses less space than traditional relational database systems
44
When loading data into an empty table, Amazon Redshift automatically:
samples your data and selects the most appropriate compression scheme.
45
Massively Parallel Processing (MPP)
Redshift automatically distributes data and query load across all nodes
46
You can scale out in Redshift by
adding more nodes
47
Backups in Redshift
1. Enabled by default with a 1 day retention period | 2. Max retention -35 days
48
Redshift pricing
1. Compute node hours - per node/hour; you will not be charged for the leader node hours, only for the compute node 2. Backup 3. Data transfer (only within a VPC, not outside it)
49
Redshift security considerations
1. Encrypted in Transit using SSL 2. Ecnrypted at rest using AES-256 encryption 3. By default, Redshift takes care of key management
50
Redshift availability
1. currently only available in 1 AZ | 2. Can restore snapshots to a new AZ in the event of an outage
51
Redshift maintains at least ? copies of your data
3 - original, replica on the compute nodes and a backup in S3
52
Redshift can also asynchronously replicate
your snapshots to S3 in another region for DR
53
How can you force a failover for MultiAZ
rebooting the instance
54
Read replicas can be multi-AZ - True or false
True
55
Prerequisite for enabling read replicas
Must have backups turned on
56
Read replicas can be in different regions - true or false
true
57
Read replicas can be which RDS?
aurora or mysql
58
Read replicas can be promoted to master - what will this mean
that it will break the replication
59
Amazon Aurora
MySQL compatible, relational database engine that combines the speed and availability of high end commercial databases with the simplicity and cost effectiveness of open source databases
60
Aurora in comparison to MySQL
5 x better performance at a price point 1/10th that of a commercial database while delivering similar performance and availability
61
Aurora is compatible with
MySQL and PostgreSQL
62
Aurora starting size
10GB, scales in 10GB increments to 64TB (Storage Auto Scaling)
63
Aurora's compute resources can scale up to
32vCPUs and 244GB of Memory
64
Aurora's copies of your data
2 copies/AZ with min of 3 AZ (6 copies of your data)
65
Aurora is only available in Regions with 3 AZs- true or false
true
66
Aurora is designed to transparently handle the loss
of up to 2 copies of data w/out affecting database write availability and up to 3 copies without affecting read availability
67
Aurora storage when it comes to issues/problems
self healing; Data blocks and disks are continuously scanned for errors and repaired automatically
68
2 types of Aurora Replicas
1. Aurora Replicas - 15 | 2. MySQL Read Replicas -5
69
of Replicas for Amazon Aurora
up to 15
70
of Replicas for MySQL Replicas
up to 5
71
Replication type for Amazon Aurora
Asynchronous (milliseconds)
72
Replication type for MySQL Replicas
Asynchronous (seconds)
73
Performance impact on primary for Amazon Aurora
Low
74
Performance impact on primary for MySQL Replicas
High
75
Act as failover target for Aurora
Yes (no data loss)
76
Act as failover target for MySQL Replicas
Yes (potentially mins of data loss)
77
Automated failover for Aurora
Yes
78
Automated failover for MySQL Replicas
No
79
Support for user-defined replication delay -Aurora
No
80
Support for user-defined replication delay - MySQL Replicas
Yes
81
Support for different data or schema vs primary - Aurora
No
82
Support for different data or schema vs primary- MySQL Replicas
Yes
83
Backups with Aurora
1. automated backups are always enabled (doesn't impact db performance) 2. snapshots (no impact to performance)
84
Aurora snapshots can be shared
with other AWS accounts
85
Memcached
1. Simple Cache to offload DB 2. Ability to scale horizontally 3. Multi-threaded performance
86
Redis
1. Simple Cache to offload DB 2. Not able to scale horizontally 3. No multi-threading 4. Advanced Data types 5. Ranking/sorting data sets 6. Pub/sub capabilities 7. Persistence 8. Multi_AZ 9. Backup and Restore capabilities
87
MySQL/Maria DB Port default
3306
88
Oracle default Port
1521
89
PostGre SQL default Port
5432
90
SQL Server Default Port
1433
91
Provisioning a database instance for PROD
Multi-AZ
92
Provisioning a database instance for DEV/TEST
Single AZ - default storage:20GB
93
3 Database Instance Class
1. T2/T3 Family: Burstable instances 1- 8 vCPU, 1 - 32 GB RAM, Moderate networking Perf 2.M3/M4 Family: GP instances 2-64 vCPU, 8 - 256GB RAM, High Perf networking 3.R3/R4 Family: Memory optimized instances 2-64 vCPU, 16 - 488 GB RAM, High Perf Networking
94
EBS volumes are being used by which databases
MySQL, MariaDB, PostgreSQL, Oracle and SQL Server
95
Aurora uses what storage system
proprietary storage system
96
3 types of database storage classes:
1. GP2 - General Purpose SSD storage; Max 16TB; 3 IOPS per GB; Bursts to 3000 IOPS 2. IO1 - Provisioned IOPS SSD storage; Max 16TB; Max 40K IOPS (20k for SQL); IO intensive workloads 3. Magnetic - magnetic storage; Max 16 TB; Supported for Legacy DBS
97
Provisioning DB costs
1. DB engine and Version 2. License Model 3. Database Instance Class 4. Multi-AZ Deployment 5. Storage Type and allocation
98
If i want to scale my instance class in a Multi-AZ environment, which instance gets resizes first
Secondary
99
When can failovers occur in a multi-AZ?
1. AZ outage 2. Primary DB instance fails 3. DB instance class changed 4. Software Patching 5. Manual Failover