Database Services Flashcards

1
Q

What is the advantage of relational database?

A

You don’t have to understand upfront how you’re going to query the data.

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

What’s the difference between OLTP and OLAP?

A

OLTP is a relational database optimized for fast, frequent transactions. OLTP database may have intense memory requirements so that it can store frequently accessed portions of tables in memory for quick access.

OLAP is a relational database optimized for large, complex queries. OLAP databases tend to have heavy compute and storage requirements, as complex query requires more computation power and it’s common to aggregate multiple database into a single OLAP database.

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

What does AWS RDS provide?

A

AWS RDS takes care of

  • Setup the database system
  • Perform backup
  • Ensure high availability
  • Patch DB and OS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which storage engine of MySQL or MariaDB should be used with RDS?

A

InnoDB, as it is the only one compatible with RDS-managed automatic backups.

The other storage engine is MyISAM.

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

What’s the use case of RDS for PostgreSQL?

A

PostgreSQL advertises itself as the most Oracle‐compatible open source database. This is a good choice when you have in‐house applications that were developed for Oracle but want to keep costs down.

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

What’s the use case of Amazon Aurora?

A

Aurora is Amazon’s drop‐in binary replacement for MySQL and PostgreSQL, which offers better write performance by using a virtualized storage layer.

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

How to calculate IOPS based on throughput for RDS?

A

MySQL and MariaDB has a page size of 16 KB. The rest DBs’ page size is 8 KB.

To get 100MB/s throughput,

  • MySQL and Maria DB needs 6,400 IOPS
  • The rest needs 12,800 IOPS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How RDS allocate IOPS based on storage size with General Purpose SSD?

A

For each gigabute of data that you allocate to a volume, RDS allocate a baseline performance of 3 IOPS.

A 20 GB volume would get 60 IOPS, whereas a 100 GB volume would get 300 IOPS. A 5,334 GB volume would get 16,000 IOPS.

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

What is burst IOPS with General Purpose SSD?

A

Volumns smaller than 1 TB can temporarily burst to 3,000 IOPS. The duration of the burst is determined by the size of the volumn.

For example, with a 200 GB volume, the burst duration would be 2,250 seconds, or 37.5 minutes.

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

What are four storage options for RDS?

A
  • General Purpose SSD (gp2)
  • Provisioned SSD (io1)
  • Throughput-Optimized HDD (st1)
  • Cold HDD (sc1)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How many read replicas does RDS support?

A
  1. Amazon Aurora supports up to 15.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How to make RDS highly available?

A

Enable Multi-AZ deployment.

Enabling Multi-AZ deployment will cause significant performance hit, so be sure to do it during a maintenance window.

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

How long does it take for RDS to failover with a Multi-AZ deployment?

A

Within 2 minutes.

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

What’s the difference between read replica and standby instance of a primary database?

A

Data replication:

  • Read replica: asynchronous
  • Standby instance: synchronous

Endpoint:

  • Read replica: separate endpoint
  • Standby instance: share the same endpoint from the primary database

Serve Requests:

  • Read replica: serve readonly requests
  • Standby instance: does not serve any requests until failover
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the two options for Multi-AZ with Amazon Aurora?

A
  • Single-Master

- Multi-Master

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

What is the RPO and RTO of Point-in-Time Recovery (PITR) of RDS?

A

5 minutes or under.

PITR archives database change logs to S3 every 5 minutes.

Restoring to a point-in-time can take hours, depending on how much data is in the transaction log.

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

Where is the snapshot of RDS stored?

A

S3

18
Q

How to enable Point-in-Time Recovery (PITR) of RDS?

A

By enabling automated backups of RDS.

19
Q

What is the difference between maintenance window and backup window of RDS?

A

Maintenance window handles maintenance items including OS patches and non-breaking minor version upgrades.

Backup window creates snapshots of your RDS instance.

20
Q

What is Redshift?

A

Redshift is Amazon’s managed data warehouse service.

Although it’s based on PostgreSQL, it’s not part of RDS.

Redshift supports JDBC and ODBC.

21
Q

What is AWS Data Migration Service (DMS)?

A

The AWS Database Migration Service (DMS) can automatically copy an existing database and its schema (if applicable) to another database.

What makes DMS particularly powerful is its ability to migrate data between different database engines and between relational and nonrelational databases.

DMS provisions an EC2 instance called a DMS instance that’s the brains behind DMS. It initiates connections to the source and target databases and performs the replication and any necessary schema conversions between them.

22
Q

What are the unique characteristics of non-relational database?

A
  • Non-relational database is schemaless and don’t require all items in a table to have the same attributes.
  • The trade‐off for having flexibility to store unstructured data comes in terms of being more limited in your queries. Nonrelational databases are optimized for queries based on the primary key. Queries against other attributes are slower, making nonrelational databases inappropriate for complex or arbitrary queries. Prior to creating a table, you need to understand the exact queries that you’re going to need to perform against the data.
  • Nonrelational databases do not give you a way to split data across tables and then merge it together at query time. Therefore, an application will generally keep all its data in one table. This can lead to the duplication of data, which in a large database can incur substantial storage costs.
23
Q

What are different types of non-relational databases?

A

All nonrelational databases are key/value store databases.

A document‐oriented store is a particular application of a nonrelational database that analyzes the contents of a document stored as a value and extracts metadata from it.

A graph database, such as Amazon Neptune, analyzes relationships between attributes in different items. This is different than a relational database that enforces relationships between records. A graph database discovers these relationships in unstructured data.

24
Q

What is the primary key of a DynamoDB table?

A
  • Partition Key (2048 B)
  • Sort Key (optional, 1024 B)

DynamoDB distributes your items across partitions based on the partition key.

Items are sorted in the partition by sort key.

25
Q

What is a hot partition in DynamoDB?

A

When a lot of read or write activity occurs against items stored in the same partition, the partition is said to be a hot partition.

To avoid hot partitions, try to make your partition keys as specific as possible. For example, if you’re storing log entries, consider using a timestamp that changes frequently as the partition key.

26
Q

What is the size limit of a DynamoDB item?

A

400 KB.

27
Q

What are data types supported by DynamoDB?

A
  • Scalar
  • Multi-valued Set
  • Document (List, Map)
28
Q

What are the throughput capacity modes of DynamoDB?

A
  • On Demand

- Provisioned (can enable Auto Scaling)

29
Q

What are consistency models of reading from DynamoDB?

A
  • Strongly consistent

- Eventually consistent

30
Q

How much RCU is required to read an item up to 4KB with the two consistency models?

A
  • Strongly consistent: 1 RCU

- Eventually consistent: 0.5 RCU

31
Q

How much data can 1 WCU write per second?

A

1 KB.

This means if you need to write 100 items per second, each item being less than 1 KB, you’d have to provision 100 WCUs.

32
Q

Does DynamoDB offer auto-scaling with Privisioned mode?

A

Yes.

33
Q

Can you reserve RCU and WCU with DynamoDB?

A

Yes.

34
Q

What are the two modes to read data from DynamoDB table?

A
  • Scan

- Query (based on partition key or sort key)

35
Q

What is secondary index of DynamoDB?

A

Secondary index copies some attributes from the base table.

A secondary index always includes the partition and sort key attributes from the base table. You can choose to copy just the partition and sort keys and their values, the keys plus other attributes, or everything. This lets you extract only the data you need.

36
Q

What are the two types of secondary index of DynamoDB?

A
  • Global secondary index
    x Can be created after table is created
    x Partition key and sort key can both be different
  • Local secondary index
    x Must be created at the same time as the base table
    x Partition key must be the same as base table
    x Sort key can be different.
37
Q

What is consistency model of reads from secondary index of DynamoDB tables?

A

Eventually consistent.

38
Q

What is Global Tables of DynamoDB?

A

To improve availability, you can use global tables to replicate a table across multiple regions.

To use global tables, your table must be configured in on‐demand mode or provisioned mode with Auto Scaling enabled.

Global tables don’t support strongly consistent read across regions.

39
Q

Can you bring your own license to use RDS for SQL Server?

A

No.

40
Q

What are the limits of secondary index of a DynamoDB table?

A

5 global and 5 local secondary indexes.

41
Q

What is the retention period range of Point-in-Time Recovery?

A

5 minutes to 35 days.