AWS DB Flashcards

1
Q

DynamoDB: How can you make sure to get the most up-to-date items on a ‘GetItem’ call?

A

Set the ‘ConsistentRead’ parameter to ‘true’ when using the ‘GetItem’ operation

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

When issuing the COPY command to copy S3 data to Redshift, you receive the following error:

‘[Amazon] (500310) Invalid operation: S3ServiceException’

What is the likely cause?

A

an incorrect or non-existent IAM access key

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

Aurora MySQL:

All database schema and permissions changes must be captured by auditing. How do you achieve this? (2)

A

(1) Enable Advanced Auditing
(2) Specify ‘QUERY_DCL’ and ‘QUERY_DDL’

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

What is DCL in a MySQL table?

A

Data Control Language query (GRANT or REVOKE permissions)

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

What is DDL in a MySQL table?

A

Data Definition Language (CREATE or ALTER table schema)

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

How can you use on-prem Active Directory to allow access to an RDS database? (2)

A

Create a forest trust between existing AD and AWS Directory Service for Microsoft Active Directory (AKA AWS Managed Microsoft AD).

Configure RDS to operate with “mixed mode authentication”

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

How can you protect a Redis Cluster from unauthorized access? (2)

A

Adjust Security Group to only allow trusted clients, and only on TCP port 6379

Enable encryption (in transit & at rest) including Redis AUTH. Clients must use ‘auth-token’) parameter when connecting.

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

Easiest way to prevent changes to a DB when additional services are added to its CloudFormation template? (2)

A

Use a stack policy to deny updates to the DB.

Review the change set before deploying new resources.

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

In addition to setting the ‘DeletionPolicy’ to ‘retain’ and the ‘DeletionProtection’ attribute of a CF template to ‘true’, what step should be taken to make sure there is not accidental data loss when a CF stack is deleted?

A

Set the ‘DeleteAutomatedBackups’ property of the DB resource to ‘false’

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

What can be used to minimize writer downtime in the event of a failure on your main Aurora instance?

A

Cluster Cache Management (CCM)

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

How can you provide a cross-region snapshot for a Redshift cluster?

A

launch a ‘snapshot copy grant’ for a master key in the backup Region. Enable cross-Region snapshots on the cluster.

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

T/F: You can alter the default parameter group of an RDS table?

A

False

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

Why can’t you use cross-region replication on the S3 bucket storing your RDS snapshots?

A

Because you do not have access/control over that underlying S3 bucket.

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

How often is the automated snapshot on RDS? Can you get snapshots more frequently?

A

24 hours.

You could manually collect more frequent snapshots or configure a lambda function to automate the process.

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

Can you have encrypted Read Replicas of unencrypted RDS instances?

A

no

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

What is the likeliest cause of significant replication lag when reading from a read replica (RDS)?

A

There are long-running queries on the primary DB instance

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

How long can automated RDS snapshots be retained?

A

35 days

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

How can you save an RDS snapshot for years?

A

Have a Lambda function take a manual snapshot and store it in an S3 bucket.

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

What is an Aurora cluster-level parameter to monitor health of your cluster when issuing a large number of COMMIT and ROLLBACK commands to the database?

A

IO:XactSync

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

For a Microsoft SQL Server migration, how does DMS read ongoing changes from the source database?

A

using the ‘fn_dblog()’ or ‘fn_dump_dblog()’ function in SQL Server to read from the transaction log based on the Log Sequence Number (LSN)

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

DynamoDB: How can you ensure stale data is not cached in Elasticache?

A

Use a write-through caching strategy.

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

Elasticache: How can you minimize wasted space on the cluster?

A

Enable Time to Live (TTL) on the Elasticache cluster

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

How do you move an automated snapshot of an RDS instance to another region?

A

You must first copy it as a manual snapshot, then you may transfer it to another region.

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

RDS for PostgreSQL: How can you reduce the storage impact of logs on the DB instance?

A

Publish logs to CloudWatch. Reduce the ‘rds.log_retention_period’ parameter from default 4,320 minutes to a smaller value like 1,440 minutes (1 day). This will reduce the total log storage space needed on the instance itself.

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

What is the fastest way to migrate RDS PostgresQL to an Aurora instace?

A

Generate an Aurora Read Replica and promote it to a standalone Aurora DB cluster upon cut-over.

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

What is wrong with this: I want to stop my RDS instance for a month to reduce cost while it is not in use.

A

Stopped RDS instances automatically start in 7 days to make sure they do not miss critical patches

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

Redis: how to establish fault-tolerance with data loss not exceeding one hour? (2)

A

Set up Elasticache Multi-AZ with automated failover

Schedule Manual backups using Redis Append-Only file (AOF)

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

How can you migrate to an RDS instance of different storage size

A

Do a homogenous replication using DMS to a newly created RDS instance of the desired size. Restoring from a snapshot will always create a DB of the same storage size as the original RDS instance.

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

What command is used to copy data from S3 to a redshift cluster?

A

‘COPY’

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

When doing a COPY from S3 to Redshift, what does it mean if you get a ‘[Amazon] (500310) Invalid operation: S3ServiceException’ error?

A

You’ve used an incorrect or nonexistent IAM access key to access the S3 bucket.

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

What is the most likely cause of missing an automated daily RDS snapshot? (2)

A

A copy of the snapshot for this DB instance is ongoing in the same region.

the DB instance is in the ‘STORAGE_FULL’ state.

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

What will happen to your DynamoDB Streams settings when you restore DDB to a recent backup?

A

They will not be included and need to be re-implemented.

(also TTL, tags, CloudWatch metrics and alarms, IAM policies, and Auto scaling policies)

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

RDS snapshot recovery: what needs to be re-configured once you create a new DB from a snapshot? (2)

A

Security group, any custom parameter groups

(by default, it will attach the default SG, not allowing traffic.)

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

How can you increase the number of connections allowed to a single Aurora DB instance? (to avoid ‘Too many connections’ errors?) (2 - OR)

A

Set a larger value for ‘max_connections’ in the DB parameter Group.

OR

Scale up the instance class to achieve more memory and a higher default ‘max_connections’.

35
Q

How can you reduce the load on an aurora cluster that is experiencing a spike in IO:Xactsync?

A

configure your application to commit transactions in batches.

36
Q

Aurora PostgreSQL: How can you produce an audit log containing information on all connections to the DB?

Then send to a 3rd-party tool?

A

Set up database activity streams and send encrypted logs to an Amazon Kinesis stream. Integrate the stream with the 3rd-party tool.

37
Q

DynamoDB: How to always fetch most up-to-date data when using GetItem API?

A

Set the “ConsistentRead” parameter to ‘true’ when using the ‘GetItem’ operation

38
Q

How can you make sure multiple users do not interfere with each other’s ‘UpdateItem’ operations on a DynamoDB table?

A

Use condition expressions in the ‘UpdateItem’ Operations.

For instance, you could set a condition to see if the CURRENT value is the same as when you started your operation. If it has changed, you can abort your update.

39
Q

Can BatchWriteItem be used to Update items? (DynamoDB)

A

No

40
Q

What is the FASTEST way to load data from a predefined data set to Amazon Aurora?

A

Load flat files to S3 and use the “LOAD DATA FROM S3” command to fetch that data into Aurora (of course you must also grant it permissions).

This method diminishes in effectiveness once the size of the data increases significantly. Then you might consider SQL which is slower but can use small batch sizes.

41
Q

What Redshift feature allows it to scale to meet fluctuating numbers of incoming queries?

A

Concurrency Scaling

42
Q

DynamoDB: How do you retry only the unprocessed items in the event that your BatchGetItem or BatchWriteItem operations return a partial result?

A

use the ‘UnprocessedKeys’ map from the response to reprocess the failed items.

43
Q

Which elasticache option allows for multi-threaded processing of cached queries?

A

While Redis is generally more feature-rich and can scale out, Memcached is the service which can accommodate multi-threaded command execution.

44
Q

Neptune: What tool can be used to bulk load CSVs from S3?

A

The Bulk Loader API with Gremlin

45
Q

What is the main restriction when bulk loading CSVs into Neptune using the Bulk Loader API with Gremlin?

A

The set of CSV files for each load command must be in the same folder in S3

46
Q

When defining a new Secret for Secrets Manager in Cloudformation, what resource attribute will allow you to set the period after which the secret rotates?

A

AWS::SecretsManager::RotationSchedule

47
Q

What Aurora feature should be used when you want to make copies of the main instance upon request without impacting production

A

The Aurora Clone Feature

48
Q

RDS: What is the easiest way to view a record of SQL statements and investigate a performance incident?

A

Review the performance insights dashboard

49
Q

What 2 conditions will make it so you cannot delete an aurora instance in a cluster? (both needed)

A

The cluster is a read replica of another cluster

The instance is the only instance in the cluster

50
Q

Other than a Neptune instance, an S3 bucket, and the necessary IAM permissions, what is needed to do the ‘Loader’ command to populate Neptune from data in S3?

A

an s3 VPC endpoint

51
Q

When it comes to making a DB subnet group in your VPC, what 2 features should be considered?

A

The DB subnet group should include at least 2 subnets, in each of at least 2 different AZs.

All subnets in the group must be public OR private. The group cannot be a mix of both.

52
Q

What does AWS provision for you when you create an Aurora Activity Stream?

A

a Kinesis stream which can be connected to other applications.

53
Q

Are RDS performance insights provisioned on the per-instance level, or the per-cluster level?

A

per-instance

54
Q

What are the retention options for RDS performance insights?

A

7 days

or

2 years

55
Q

DMS: How do you load a large partitioned table most efficiently?

A

Create multiple tasks that divide the large table load based on its partition key

56
Q

DMS: How do you prevent DMS from launching too many parallel table load tasks?

A

Limiting the MaxFullLoadSubTasks

57
Q

What is the default MaxFullLoadSubTasks in DMS? When should you change this?

A
  1. This can be raised when your replication instance is very large, or reduced when you are using a smaller DMS replication instance type.
58
Q

You have set up IAM Database Authentication for your RDS PostgreSQL instance. You have given the IAM users the appropriate ‘rds-db:connect’ permission, but they are still unable to connect. Why?

A

The ‘rds_iam’ role needs to be granted in the PostgreSQL database user

59
Q

The most cost-effective way to homogenously migrate a large (1TB) on-prem MySQL server to AWS RDS? (5[?!?])

A

Enable binary logging replication on-prem

Create a backup using mysqldump and compress it

Load compressed files to EC2 and uncompress

Connect RDS and load data

Enable replication from on-prem to RDS

60
Q

The fastest way to encrypt an unencrypted Aurora DB

A

Restore a snapshot of the unencrypted cluster to an encrypted cluster. (Can do in Aurora, NOT vanilla RDS)

61
Q

DMS - how to ensure you can fully validate successful data transfer before making the cut-over?

A

Make sure ‘enable validation’ and ‘enable cloudwatch logs’ are both turned on.

62
Q

When using IAM database authentication (RDS PostgreSQL), what should a data engineer do to generate access credentials for users who need temporary access?

A

Execute the generate-db-auth-token command with the user names to generate a temporary password for the users

63
Q

What settings have to be true in an RDS PostgreSQL database in order to switch to IAM database authentication while the instance is running?

A

‘ssl’ must be set to ‘1’, then you can simply ‘Enable IAM Database Authentication’

64
Q

DMS - How do you most quickly migrate tables with LOBs?

A

Use limited LOB mode and provide the largest LOB size. (Any larger LOBs are truncated)

65
Q

What is the maximum LOB size in Limited LOB mode?

A

100MB

66
Q

DMS Heterogeneous migration - How can you review the license requirements and hardware configurations for both source and target databases?

A

Use AWS Schema Conversion Tool (AWS SCT) and create a database migration assessment report.

67
Q

Can you modify an existing Aurora stand-alone cluster to an Aurora Serverless cluster?

A

No. You must restore it from a snapshot to an Aurora Serverless cluster.

68
Q

What is the likeliest cause of an Aurora cluster cutover to a Read Replica taking 5 minutes?

A

The client-side application has a TTL for the DNS of 5 minutes. This setting should be no more than 30 seconds to allow faster DNS-based fail-over.

69
Q

How can you improve the read performance AND data capacity of an existing Redis cluster where cluster mode is disabled?

A

Make instance bigger. (cannot enable cluster mode, must create new Redis cluster to do this)

70
Q

How can you improve the read performance of an existing Redis cluster where cluster mode is disabled?

A

add redis cluster with read replica nodes OR make instance bigger. (cannot enable cluster mode, must create new Redis cluster to do this)

71
Q

What is the fastest way to migrate an existing RDS PostgreSQL database from the default VPC to a more highly secure new VPC in the same region?

A

Create a new DB Subnet group associated with the new VPC (in the same AZs as current instance). Associate the RDS instance to the new DB Subnet group.

72
Q

How long can it take DynamoDB to delete expired items using TTL.

A

It does this on a best-effort basis as to not impact performance. It is usually within 48 hours of the item’s expiration.

73
Q

T/F Aurora allows the use of the backtrack feature, but RDS does not

A

True.

74
Q

RDS - what can prevent the creation of a read replica

A

The automatic snapshot retention period must be set to a value greater than 0 (the default)

75
Q

DocumentDB - what 2 steps to audit events where an index or collection is created or dropped.

A

in custom parameter group - enable ‘audit_logs’

Modify the DocumentDB cluster to export the audit logs to CloudWatch

76
Q

Easiest way to get notified when management events or maintenance tasks occur on your Redshift cluster?

A

create an event subscription that sends a notification for Management events FROM THE Redshift console.

77
Q

DocumentDB - how can you identify the slowest-running queries on your cluster?

A

You must enable the profiler feature and send logs to CloudWatch

78
Q

How do you exclude a specific set of Aurora instances from an endpoint when more replica instances may be added to the cluster in the future?

A

Create an ANY custom endpoint with an exclusion list

79
Q

How can you integrate queries between data hosted on PostgreSQL RDS and a Redshift cluster that are hosted in different regions? (2)

A

Connect your Redshift cluster to the PostgreSQL DB

Create an external schema from the PostgreSQL database and use federated queries

80
Q

RDS - How to quickly fix STORAGE FULL

A

increase the storage size, after which storage autoscaling can be configured.

81
Q

If you have a predictable DynamoDB load with lots of UpdateItem requests and you are getting ProvisionedThroughputExceededException at high traffic, what should you do?

A

Use provisioned mode to forecast capacity for high demand. Increase the provisioned WCUs

82
Q

What can prevent enabling AUTH for a Redis cluster

A

encryption in-transit must be enabled at creation of the Redis cluster, and is required.

83
Q

How do you test a disc failure event on Aurora?

A

fault injection queries