AWS DB Flashcards
DynamoDB: How can you make sure to get the most up-to-date items on a ‘GetItem’ call?
Set the ‘ConsistentRead’ parameter to ‘true’ when using the ‘GetItem’ operation
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?
an incorrect or non-existent IAM access key
Aurora MySQL:
All database schema and permissions changes must be captured by auditing. How do you achieve this? (2)
(1) Enable Advanced Auditing
(2) Specify ‘QUERY_DCL’ and ‘QUERY_DDL’
What is DCL in a MySQL table?
Data Control Language query (GRANT or REVOKE permissions)
What is DDL in a MySQL table?
Data Definition Language (CREATE or ALTER table schema)
How can you use on-prem Active Directory to allow access to an RDS database? (2)
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 can you protect a Redis Cluster from unauthorized access? (2)
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.
Easiest way to prevent changes to a DB when additional services are added to its CloudFormation template? (2)
Use a stack policy to deny updates to the DB.
Review the change set before deploying new resources.
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?
Set the ‘DeleteAutomatedBackups’ property of the DB resource to ‘false’
What can be used to minimize writer downtime in the event of a failure on your main Aurora instance?
Cluster Cache Management (CCM)
How can you provide a cross-region snapshot for a Redshift cluster?
launch a ‘snapshot copy grant’ for a master key in the backup Region. Enable cross-Region snapshots on the cluster.
T/F: You can alter the default parameter group of an RDS table?
False
Why can’t you use cross-region replication on the S3 bucket storing your RDS snapshots?
Because you do not have access/control over that underlying S3 bucket.
How often is the automated snapshot on RDS? Can you get snapshots more frequently?
24 hours.
You could manually collect more frequent snapshots or configure a lambda function to automate the process.
Can you have encrypted Read Replicas of unencrypted RDS instances?
no
What is the likeliest cause of significant replication lag when reading from a read replica (RDS)?
There are long-running queries on the primary DB instance
How long can automated RDS snapshots be retained?
35 days
How can you save an RDS snapshot for years?
Have a Lambda function take a manual snapshot and store it in an S3 bucket.
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?
IO:XactSync
For a Microsoft SQL Server migration, how does DMS read ongoing changes from the source database?
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)
DynamoDB: How can you ensure stale data is not cached in Elasticache?
Use a write-through caching strategy.
Elasticache: How can you minimize wasted space on the cluster?
Enable Time to Live (TTL) on the Elasticache cluster
How do you move an automated snapshot of an RDS instance to another region?
You must first copy it as a manual snapshot, then you may transfer it to another region.
RDS for PostgreSQL: How can you reduce the storage impact of logs on the DB instance?
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.
What is the fastest way to migrate RDS PostgresQL to an Aurora instace?
Generate an Aurora Read Replica and promote it to a standalone Aurora DB cluster upon cut-over.
What is wrong with this: I want to stop my RDS instance for a month to reduce cost while it is not in use.
Stopped RDS instances automatically start in 7 days to make sure they do not miss critical patches
Redis: how to establish fault-tolerance with data loss not exceeding one hour? (2)
Set up Elasticache Multi-AZ with automated failover
Schedule Manual backups using Redis Append-Only file (AOF)
How can you migrate to an RDS instance of different storage size
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.
What command is used to copy data from S3 to a redshift cluster?
‘COPY’
When doing a COPY from S3 to Redshift, what does it mean if you get a ‘[Amazon] (500310) Invalid operation: S3ServiceException’ error?
You’ve used an incorrect or nonexistent IAM access key to access the S3 bucket.
What is the most likely cause of missing an automated daily RDS snapshot? (2)
A copy of the snapshot for this DB instance is ongoing in the same region.
the DB instance is in the ‘STORAGE_FULL’ state.
What will happen to your DynamoDB Streams settings when you restore DDB to a recent backup?
They will not be included and need to be re-implemented.
(also TTL, tags, CloudWatch metrics and alarms, IAM policies, and Auto scaling policies)
RDS snapshot recovery: what needs to be re-configured once you create a new DB from a snapshot? (2)
Security group, any custom parameter groups
(by default, it will attach the default SG, not allowing traffic.)