DBS-C01 Workload-Specific Database Design • Complete Question Bank
Complete DBS-C01 Workload-Specific Database Design question bank — all 0 questions with answers and detailed explanations.
Refer to the exhibit. ``` 2024-03-15 10:23:45 UTC | aurora-db-instance-1: Aurora MySQL 2024-03-15 10:23:45 UTC | 10.0.1.5:12345 [3] [thread 1] [transaction 1234] 2024-03-15 10:23:45 UTC | ERROR: Deadlock found when trying to get lock; try restarting transaction 2024-03-15 10:23:45 UTC | at line 1: UPDATE orders SET status='shipped' WHERE order_id=1001; 2024-03-15 10:23:45 UTC | at line 2: UPDATE inventory SET quantity=quantity-1 WHERE product_id=500; ```
Refer to the exhibit.
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:GetItem",
"dynamodb:PutItem",
"dynamodb:UpdateItem",
"dynamodb:DeleteItem"
],
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/UserSessions",
"Condition": {
"ForAllValues:StringEquals": {
"dynamodb:LeadingKeys": ["${aws:userid}"]
}
}
}
]
}
```Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Drag a concept onto its matching description — or click a concept then click the description.
Relational database service with managed instances
NoSQL key-value and document database
In-memory caching service supporting Redis and Memcached
Petabyte-scale data warehouse
MongoDB-compatible document database
Drag a concept onto its matching description — or click a concept then click the description.
SSD storage with baseline IOPS and burst credits
SSD storage with consistent IOPS for I/O-intensive workloads
Previous generation HDD storage, lowest cost
SSD storage with baseline IOPS and throughput independent of size
Block Express SSD with higher durability and IOPS
Refer to the exhibit.
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["dynamodb:GetItem", "dynamodb:PutItem"],
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/Orders",
"Condition": {
"ForAllValues:StringEquals": {
"dynamodb:LeadingKeys": ["customer_123"]
}
}
}
]
}
```Refer to the exhibit.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "dynamodb:PutItem",
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/Orders"
},
{
"Effect": "Deny",
"Action": "dynamodb:GetItem",
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/Orders"
}
]
}Refer to the exhibit.
Consider the following IAM policy attached to an IAM role used by an application:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:GetItem",
"dynamodb:Query",
"dynamodb:PutItem"
],
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/orders",
"Condition": {
"ForAllValues:StringEquals": {
"dynamodb:LeadingKeys": ["${aws:userid}"]
}
}
}
]
}Refer to the exhibit.
Consider the following AWS CLI command output for an Amazon RDS instance:
{
"DBInstances": [
{
"DBInstanceIdentifier": "mydb",
"DBInstanceClass": "db.r5.large",
"Engine": "mysql",
"DBInstanceStatus": "available",
"MasterUsername": "admin",
"Endpoint": {
"Address": "mydb.abcdef123456.us-east-1.rds.amazonaws.com",
"Port": 3306
},
"MultiAZ": false,
"StorageType": "gp2",
"AllocatedStorage": 100,
"ReadReplicaSourceDBInstanceIdentifier": "mydb-primary"
}
]
}Refer to the exhibit.
Consider the following CloudFormation template snippet:
Resources:
MyDynamoDBTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: "UserSessions"
AttributeDefinitions:
- AttributeName: "user_id"
AttributeType: "S"
- AttributeName: "session_id"
AttributeType: "S"
KeySchema:
- AttributeName: "user_id"
KeyType: "HASH"
- AttributeName: "session_id"
KeyType: "RANGE"
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
TimeToLiveSpecification:
AttributeName: "expire_time"
Enabled: trueRefer to the exhibit.
=== IAM Policy for DynamoDB Access ===
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowReadAccess",
"Effect": "Allow",
"Action": "dynamodb:GetItem",
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/Orders",
"Condition": {
"ForAllValues:StringEquals": {
"dynamodb:Attributes": ["order_id", "status"]
}
}
},
{
"Sid": "DenyWriteAccess",
"Effect": "Deny",
"Action": "dynamodb:*",
"Resource": "*"
}
]
}Refer to the exhibit. === Amazon RDS MySQL Error Log === 2023-03-15 10:45:12 123456 [ERROR] [MY-013142] [Server] InnoDB: Table 'mydb.orders' has a FULLTEXT index on column 'description'. The maximum column length for FULLTEXT index is 4294967295. However, the column length is 4294967295 which may cause performance issues. 2023-03-15 10:45:12 123456 [ERROR] [MY-010067] [Server] Cannot create FULLTEXT index on column 'description' because the column is too long.
Refer to the exhibit.
=== CloudFormation Snippet ===
Resources:
MyDBInstance:
Type: AWS::RDS::DBInstance
Properties:
Engine: MySQL
DBInstanceClass: db.r5.large
MultiAZ: true
StorageType: gp2
AllocatedStorage: 200
DBSubnetGroupName: !Ref MyDBSubnetGroup
VPCSecurityGroups:
- !Ref MyDBSecurityGroup
BackupRetentionPeriod: 7
PreferredBackupWindow: '02:00-03:00'
PreferredMaintenanceWindow: 'sun:04:00-sun:05:00'
DBInstanceIdentifier: MyProdDB
MasterUsername: admin
MasterUserPassword: '{{resolve:secretsmanager:MyProdDBSecret}}'Refer to the exhibit.
IAM policy document (CloudFormation snippet):
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:GetItem",
"dynamodb:Query",
"dynamodb:Scan"
],
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/mytable",
"Condition": {
"ForAllValues:StringEquals": {
"dynamodb:LeadingKeys": ["user_${aws:userid}"]
}
}
}
]
}Refer to the exhibit. Amazon CloudWatch log snippet: 2023-03-15T10:00:00.000Z [WARN] Connection to database 'customers' timed out. Retrying... 2023-03-15T10:00:05.000Z [ERROR] Maximum retries exceeded. Unable to establish connection to RDS instance 'customers-cluster-1'.
Refer to the exhibit.
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:GetItem",
"dynamodb:PutItem",
"dynamodb:UpdateItem",
"dynamodb:DeleteItem",
"dynamodb:Query",
"dynamodb:Scan"
],
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/Orders"
},
{
"Effect": "Deny",
"Action": "dynamodb:DeleteTable",
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/Orders"
}
]
}
```Refer to the exhibit.
```
Resources:
MyDynamoDBTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: "Orders"
AttributeDefinitions:
- AttributeName: "OrderID"
AttributeType: "S"
- AttributeName: "OrderDate"
AttributeType: "S"
KeySchema:
- AttributeName: "OrderID"
KeyType: HASH
- AttributeName: "OrderDate"
KeyType: RANGE
ProvisionedThroughput:
ReadCapacityUnits: 10
WriteCapacityUnits: 5
SSESpecification:
SSEEnabled: true
```Refer to the exhibit.
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:GetItem",
"dynamodb:Query"
],
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/UserSessions"
},
{
"Effect": "Deny",
"Action": "dynamodb:*",
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/UserSessions/index/*"
}
]
}
```Consider the following IAM policy attached to an RDS DB instance:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "rds-db:connect",
"Resource": "arn:aws:rds-db:us-east-1:123456789012:dbuser:db-ABCDEFGHIJKL01234/db_user1"
}
]
}Refer to the exhibit.
IAM policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:GetItem",
"dynamodb:PutItem",
"dynamodb:UpdateItem",
"dynamodb:DeleteItem",
"dynamodb:Query"
],
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/Orders"
},
{
"Effect": "Deny",
"Action": "dynamodb:Scan",
"Resource": "*"
}
]
}Refer to the exhibit.
CloudFormation snippet:
"OrdersTable": {
"Type": "AWS::DynamoDB::Table",
"Properties": {
"TableName": "Orders",
"AttributeDefinitions": [
{"AttributeName": "OrderID", "AttributeType": "S"},
{"AttributeName": "CustomerID", "AttributeType": "S"}
],
"KeySchema": [
{"AttributeName": "OrderID", "KeyType": "HASH"}
],
"GlobalSecondaryIndexes": [
{
"IndexName": "CustomerIndex",
"KeySchema": [
{"AttributeName": "CustomerID", "KeyType": "HASH"}
],
"Projection": {
"ProjectionType": "ALL"
},
"ProvisionedThroughput": {
"ReadCapacityUnits": 5,
"WriteCapacityUnits": 5
}
}
],
"ProvisionedThroughput": {
"ReadCapacityUnits": 5,
"WriteCapacityUnits": 5
}
}
}Refer to the exhibit. Error log from application connecting to Amazon RDS for MySQL: "ERROR 1040 (08004): Too many connections" Current RDS configuration: db.r5.large, max_connections = 1000 (default).
Refer to the exhibit. CloudWatch Logs snippet: "2023-01-15T10:00:00Z [ERROR] ... Timeout error while writing to Amazon Redshift cluster." Cluster configuration: dc2.large, 2 nodes, RA3 nodes not used.
Refer to the exhibit.
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:GetItem",
"dynamodb:PutItem",
"dynamodb:UpdateItem",
"dynamodb:DeleteItem"
],
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/Orders",
"Condition": {
"ForAllValues:StringEquals": {
"dynamodb:LeadingKeys": [
"${cognito-identity.amazonaws.com:sub}"
]
}
}
}
]
}
```Refer to the exhibit.
```json
{
"MemoryReservation": {
"Value": 500
},
"MemoryUsage": {
"Value": 450
},
"ActiveTransactions": {
"Value": 20
},
"DatabaseConnections": {
"Value": 100
},
"ReadIOPS": {
"Value": 5000
},
"WriteIOPS": {
"Value": 2000
},
"ReadLatency": {
"Value": 2.5
},
"WriteLatency": {
"Value": 5.0
}
}
```
The exhibit shows CloudWatch metrics from an Amazon RDS for PostgreSQL instance (db.r5.large, 16 GB memory, 5000 provisioned IOPS). The application is experiencing slow query performance.Refer to the exhibit.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:PutItem",
"dynamodb:GetItem",
"dynamodb:Query"
],
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/Orders"
},
{
"Effect": "Allow",
"Action": "dynamodb:DeleteItem",
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/Orders",
"Condition": {
"ForAllValues:StringEquals": {
"dynamodb:Attributes": ["order_id", "status"]
}
}
}
]
}Refer to the exhibit.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:GetItem",
"dynamodb:PutItem",
"dynamodb:UpdateItem",
"dynamodb:DeleteItem",
"dynamodb:Query"
],
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/Orders"
},
{
"Effect": "Allow",
"Action": [
"dynamodb:GetItem",
"dynamodb:Query"
],
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/Orders/index/OrderDateIndex"
}
]
}{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:GetItem",
"dynamodb:Query",
"dynamodb:Scan"
],
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/MyTable"
},
{
"Effect": "Deny",
"Action": "dynamodb:Scan",
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/MyTable",
"Condition": {
"ForAllValues:StringNotEquals": {
"dynamodb:Attributes": ["pk", "sk"]
}
}
}
]
}