Databases Flashcards

1
Q

Do NoSQL databases perform aggregations such as SUM() or AVG()

A

No

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

Do NoSQL databases scale horizontally?

A

Yes

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

Is DynamoDB Highly Available across Multiple AZs out of the box?

A

Yes

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

Does Dynamo DB integrate with IAM?

A

Yes

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

DynamoDB is made of ____________?

A

Tables

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

DynamoDB tables must have a _________?

A

Partition key

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

Each DynamoDB item has________?

A

Attributes

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

What is the maximum size of an item in dynamodb?

A

400kb

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

What is a partition key in DynamoDB?

A

It acts as a primary key and must be unique for each item. It also must be diverse enough to data is distributed.

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

What two primary key options are available in DynamoDB?

A

Partition Key
Partition Key + Sort Key

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

When using a partition key and sort key in DynamoDB, what is the limitation?

A

The partition and sort key combination must be unique.

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

What are the two table classes in DynamoDB?

A

DynamoDB standard

DynamodDB standard-IA

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

What does the sort key really do in the UI?

A

Allows you to sort on a column.

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

What are the capacity modes in DynamoDB?

A

Provisioned Mode

On-Demand Mode

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

How often can you switch between capacity modes in DynamoDB?

A

Every 24 hours

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

If you exceed your RCU or WCU in DynamodDB, what error is returned?

A

ProvisionedThroughputExceededException

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

How can you deal with ProvisionedThroughputExceededException without increasing WCU or RCU?

A

Exponential Backoff

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

What is the measurement for one WCU?

A

One item per second for an item up to 1kb in size.

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

If you have an item that is 4.5kb in size, how many WCU is required?

A

5 .. Rounding up is required.

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

What are the two kinds of reads in Dynamodb?

A

Strongly Consistent

Eventually Consistent

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

What is the problem with Eventually consistent reads?

A

Old data may be returned if there is replication latency.

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

What does a consistent read in DynamoDB do?

A

It reads the data after a write, but ensures that it is the most recent data.

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

How much more RCU do ConsistentReads use?

A

Twice as much

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

A single RCU is how much for a strongly consistent read?

A

One read per second up to 4kb in size

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

A single RCU is how much for an eventually consistent read?

A

Two read per second up to 4kb in size

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

Are WCU and RCU spread evenly amongst partitions?

A

Yes.. That means if I have 5 partitions and 5 WCU, each partition will get one.

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

In DynamoDB on-Demand mode, do you need to provision RCU/WCU?

A

No. This scales up and down automatically.

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

If you want to change an item’s attributes in DynamoDB, what API call is used?

A

UpdateItem

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

If you want to create an item in DynamoDB, what API call is used?

A

PutItem

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

If you want to fully replace an item in DynamoDB, what API call is used?

A

PutItem

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

If you want to read an item in DynamoDB, what API call is used?

A

GetItem

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

What does a ProjectedExpression in DynamoDB do?

A

It can be specified to retrieve only certain attributes from an item.

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

What is a FilterExpression in DynamodDB?

A

Additional filtering after the query operation has been completed. Only works with non-key attributes and does not support hash or range.

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

How much data will scan return in DynamodDB?

A

1MB, you must use pagination to keep on reading.

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

Can you use Scan to filter out data?

A

Yes, but you are still loading all attributes. This is inefficient.

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

What can be done in DynamoDB for more performance?

A

Use Parallel Scan.

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

How many PutItem API calls can be included in a BatchWriteItem call in Dynamo DB?

A

25 PutItem and/or DeleteItem in one call.

16MB od data written and up to 400K per item.

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

Can BatchWriteItems in DynamoDB be used with UpdateItem?

A

No

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

How many GetItem API calls can be included in a BatchGetItem call in Dynamo DB?

A

100 items, up to 16MB of data

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

In DynamoDB, are items being retrieved from a BatchGetItem API call retrieved in parallel?

A

Yes

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

What is PartiQL?

A

A SQL like query language for Dynamo DB

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

What are the two types of indexes in DynamoDB?

A

LSI and GSI

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

Does an LSI use the same partition key of the base table?

A

Yes

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

What data types can be used for a sort key in an LSI?

A

String, Number, Binary

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

How many LSI can you have per table?

A

5

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

When are LSIs defined?

A

Creation of the table

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

Can LSI only include certain attributes?

A

Yes, using attribute projections.

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

Does a GSI use the same partition key of the base table?

A

No

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

Do you have to provision WCU and RCU for a GSI?

A

Yes

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

Can a GSI be added or modified after a table is created?

A

Yes

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

When a GSI is throttled, what happens to the main table?

A

It is also throttled.

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

Where do LSIs get their WCU and RCU?

A

From the main table

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

What problem does DynamoDB Accelerator (DAX) solve?

A

The problem of too many reads.

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

What is the default TTL for DynamoDB DAX caches?

A

5 minutes

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

How many nodes can be in a DAX Cluster?

A

10

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

What are DynamoDB Streams?

A

They write item level modifications in a table.

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

Where can DynamoDB Streams stream to?

A

Kinesis Data Streams

Lambda

KCL

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

How long is data in a DynamoDB Streams retained?

A

24 hours

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

What do KEYS_ONLY show in DynamoDB Streams?

A

Only the key attributes of the modified items.

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

What does NEW_IMAGE show in DynamoDB Streams?

A

The entire item as it appears after it was modified

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

What does OLD_IMAGE show in DynamoDB Streams?

A

The entire item as it appears before it was modified

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

What does NEW_AND_OLD_IMAGES show in DynamoDB Streams?

A

Both the new and old images of the item.

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

Can DynamoDB streams be used retroactively?

A

No

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

If you want Lambda to Poll DynamoDB Streams, how would you configure it?

A

Using Triggers. Use the DynamoDB trigger.

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

What does TTL do in DynamoDB?

A

It allows you to automatically delete items after an expiry timestamp.

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

Does TTL use WCU?

A

No

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

What is the max length for expired items to be deleted?

A

48 hours

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

What data type should the TTL use?

A

Number with Unix Epoch timestamp

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

What is the best way to store images in DynamoDB?

A

Use S3 for the object and store the key into dynamoDB.

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

What are Global Tables in DynamoDB?

A

Multi-Region, Multi-Active, Fully replicated tables.

71
Q

Does DynamodDB support DMS?

72
Q

Do all RDS databases support ACID transactions?

73
Q

In ACID transactions, what happens to a transactions that partially fails?

A

The entire transaction fails

74
Q

How many read replicas can you have in Aurora?

75
Q

Does Aurora have continuous backup to S3?

76
Q

What are the two types of locks?

A

Shared

Exclusive

77
Q

What does a shared lock do?

A

Allows reads, but prevents writes

78
Q

What does an exclusive lock do?

A

Prevents all reads and writes to a resource. Only one transaction can hold the lock.

79
Q

Do relational databases manage locks automatically?

80
Q

What is Document DB?

A

A NoSQL database based on MongoDB

81
Q

What is MemoryDB for Redis?

A

A redis compatible in-memory database service.

82
Q

What is Amazon Keyspaces?

A

Managed Apache Cassandra NoSQL database

83
Q

How do you query Amazon Keyspaces?

A

Cassandra Query Language (CQL)

84
Q

What is Amazon Neptune?

A

A fully managed graph database.

85
Q

What languages does Amazon Neptune support?

A

Gremlin, OpenCypher, and SPARQL

86
Q

What is Amazon Timestream?

A

A managed timestream database

87
Q

What is Amazon Redshift?

A

A petabyte scale data warehouse

88
Q

Is Redshift OLAP or OLTP?

89
Q

What nodes are in a Redshift cluster?

A

A leader node and one or more compute nodes.

90
Q

What does the leader node do?

A

It communicates with the client and also develops an execution plan.

91
Q

What do the compute nodes do?

A

They execute the execution plan generated by the leader node.

92
Q

What does each compute node have in regards to resources?

A

CPUs, Memory, and attached disk storage.

93
Q

What are node slices in Redshift?

A

They process a portion of the workload that is assigned to that node.

94
Q

Where do the resources from node slices come from?

A

They come from the resources assigned to the compute node.

95
Q

What compression does RedShift Spectrum support?

A

GZIP and Snappy

96
Q

What block size does RedShift use?

97
Q

What happens when you turn the backup retention period to zero?

A

It disables automatic backup.

98
Q

What cluster types must be used for Multi-AZ Redshift?

99
Q

Does Redshift scale horizontally or vertically?

100
Q

What is the process for Redshift Scalling on the backend?

A

Your old cluster remains available for reads

A new cluster is created

The cname is flipped to a new clister

Data moved in parallel to new compute nodes

101
Q

What are the Redshift distribution Styles?

A

Auto

Even

Key

All

102
Q

What does the Redshift distribution style Auto do?

A

The default. It bases distribution on what it thinks is best.

103
Q

What does the Redshift distribution style Even do?

A

It distributes data in a round robin fashion.

104
Q

What does the Redshift distribution style Key do?

A

It distributes data based on the value in a column.

105
Q

What does the Redshift distribution style All do?

A

It distributes the entire dataset to every node.

106
Q

How do you get data into Redshift?

A

Using the COPY Command?

107
Q

Where can I use the COPY command from?

A

S3, EMR, DynamoDB, and remote hosts

108
Q

When using the COPY command from S3, what is required?

A

A manifest file and an IAM role.

109
Q

How do you get data out of RedShift?

A

Use the UNLOAD command

110
Q

What does Enhanced VPC routing do?

A

Ensures routing happens through the AWS backbone and not the internet.

111
Q

What does Auto-Copy in S3 do?

A

It automatically loads data from S3

112
Q

What does Amazon Aurora Zero ETL do?

A

It replicates data from Aurora to RedShift

113
Q

What does Redshift Streaming ingestion do?

A

It loads data from Kinesis data streams or Managed Service for Kafka

114
Q

Is the COPY command for Redsgift meant for internal or external use?

115
Q

Can the COPY command decrypt data as it is loaded from S3?

116
Q

What is a narrow table?

A

A table with lots of rows, but few columns

117
Q

What is the best way to load a narrow table into RedShift?

A

Using a single COPY command.

118
Q

What is the process for copying a KMS encrypted snapshot to another region?

A

In the destination region you will create a KMS key

Create a copy grant

Specify the KMS key ID for which you are creating the copy grant

In the source destination you will enable copying to the copy grant you created.

119
Q

What does DBLink in RedShift do?

A

It allows you to connect to a PostgreSQL database.

120
Q

What does Redshift Workload Management (WLM) do?

A

It prioritizes short fast queries over long slow ones.

121
Q

How do you create different query queues in RedShift?

A

Using Workload Management (WLM)

122
Q

What is RedShift concurrency scaling?

A

It automatically adds cluster capacity to handle and increase in concurrent read queries.

123
Q

How many queues can you have with automatic workload management?

124
Q

What are query monitoring rules in Workload Management (WLM)?

A

They monitor queries and when the defined threshold is exceeded, an action is performed. e.g., when a query hits 60 seconds, it aborts and is moved to a long running query queue.

125
Q

How many queues can you have with manual workload management?

126
Q

What does Short Query Acceleration (SQA) do?

A

It prioritizes short running queries over loner running ones.

127
Q

Where are queries run when using Short Query Acceleration (SQA) ?

A

In a dedicated space so they don’t sit behind long queries.

128
Q

Does SQA work with CTAS?

129
Q

Are SQA and WLM similar?

130
Q

When to use SQA over WLM?

A

When all you need to do is prioritize short running queries.

131
Q

What does VACUUM do in RedShift?

A

It recovers space from deleted rows and restore sort order.

132
Q

What are the four types of vacuum commands

A

VACUUM FULL

VACUUM DELETE ONLY

VACUUM SORT ONLY

VACUUM REINDEX

133
Q

How does VACUUM FULL work?

A

Default

It resorts the rows and reclaims space from deleted rows.

134
Q

How does VACUUM DELETE ONLY work?

A

It only reclaims deleted row space

135
Q

How does VACUUM SORT ONLY work?

A

It resorts the rows, but does not reclaim disk space.

136
Q

How does VACUUM Reindex work?

A

It is used with Interleaved sort keys

137
Q

How does Elastic Resize work in RedShift?

A

You can add or remove nodes of the same type.

Cluster is down for a few minutes.

138
Q

How does Classic Resize work in RedShift?

A

You can change node types and number of nodes.

Could be read-only for hours or days.

139
Q

How do you keep your redshift cluster available while performing a classic resize?

A

Snapshot, Restore, Resize and then cut over to new cluster when copy is complete.

140
Q

What Redshift node type allows independent scaling of compute and storage?

141
Q

What does Redshift DataLake Export do?

A

Allows you to Unload Redshift Query to S3 in Parquet format.

142
Q

Does RedShift support spatial datatypes?

143
Q

Can you share live data across redshift clusters between regions?

A

Yes using cross-region data sharing.

144
Q

What is the requirement to use Redshift cross-region data sharing?

A

RA3 node types

145
Q

If you want to use your HSM witH RedShift, what certificates are required?

A

Both client and server

146
Q

Does Redshift come in serverless?

147
Q

What is a good use case for Redshift serverless?

A

Test environments

Ad hoc business analysis

148
Q

What needs to be set up manually to use Redshift Serverless?

A

An IAM role with an action redshift-serverless:*

149
Q

How is RedShift Serverless Billed?

A

Redshift Processing Units RPUs by the hours

150
Q

Can you adjust the base capacity of RedShift Serverless RPU?

151
Q

Can you set the maximum RPU in Redshift Serverless?

152
Q

What can’t Redshift Serverless do that Redshift can?

A

Parameter Groups

Workload Management

Maintenance Windows / Version tracks

153
Q

Is Redshift Serverless externally available?

A

No. It must be called from within the VPC.

154
Q

What are some Redshift views for Monitoring performance?

A

SYS_QUERY_HISTORY

SYS_LOAD_HISTORY

SYS_SERVERLESS_USAGE

155
Q

What is a materialized view in Redshift?

A

It is precomputing the query and storing the results..

A traditional view just stores the query.

156
Q

What is materialized views good for?

A

Performance Optimization

157
Q

How do you keep materialized views in synch automatically?

A

Set AUTO REFRESH

158
Q

What does Redshift data sharing do?

A

It shares the data with other clusters for read purposes.

159
Q

What are the encryption requirements for Redshift Data Sharing?

A

Both clusters must be encrypted.

160
Q

What is a Redshift Lambda UDF?

A

It allows you to call a Lambda function in your SQL queries.

161
Q

How do you register a Redshift External Function?

A

CREATE EXTERNAL FUNCTION

162
Q

What are Redshift federated queries?

A

Allows you to access live data in Aurora and RDS using RedShift.

163
Q

How do you connect to an Aurora / RDS instance for federated queries?

A

CREATE EXTERNAL SCHEMA

164
Q

In Redshift, what are SYS views for?

A

To monitor query and workload usage.

165
Q

In Redshift, what are STV views for?

A

They monitor Transient data containing snapshots of current system data.

166
Q

In Redshift, what are SVV views for?

A

Metadata about DB objects that reference STV tables.

167
Q

In Redshift, what are STL views for?

A

Generated from logs persisted to disk.

168
Q

In Redshift, what are SVCS views for?

A

Details about queries on main and concurrency scaling clusters.

169
Q

In Redshift, what are SVL views for?

A

Details about queries on main clusters

170
Q

What is the Redshift Data API?

A

Secure HTTP endpoint for SQL Statements to Redshift clusters.

171
Q

Is the Redshift Data API asynchronous?