Company B has created an e-commerce site using DynamoDB and is designing a products table that includes items purchased and the users who purchased the item. When creating a primary key on a table which of the following would be the best attribute for the primary key? Select the BEST possible answer.
1. user_id where there are many users to few products 2. product_id where there are many products to few users category_id 3. where there are few categories to many products 4. None of the above
Correct Answer : 1 When designing tables it is important for the data to be distributed evenly across the entire table. It is best practice for performance to set your primary key where there are many primary keys to few rows. Example would be many users to few products. An example of bad design would be a primary key of product_id where there are few products but many users
Question : What happens, by default, when one of the resources in a CloudFormation stack cannot be created?
1. Previously-created resources are kept but the stack creation terminates. 2. Previously-created resources are deleted and the stack creation terminates. 3. The stack creation continues, and the final results indicate which steps failed. 4. CloudFormation templates are parsed in advance so stack creation is guaranteed to succeed.
Correct Answer : 2
Explanation: By default, the "automatic rollback on error" feature is enabled. This will cause all AWS resources that AWS CloudFormation created successfully for a stack up to the point where an error occurred to be deleted. This is useful when, for example, you accidentally exceed your default limit of Elastic IP addresses, or you don't have access to an EC2 AMI you're trying to run. This feature enables you to rely on the fact that stacks are either fully created, or not at all, which simplifies system administration and layered solutions built on top of AWS CloudFormation.
Question :
For best performance when retrieving data from a table, what "type" of API call should you perform?
1. scan 2. query 3. query then scan 4. filtered
Correct Answer : 2
The query API call queries the primary key field only. The scan API call will scan all fields and rows in the database for a result set. With larger tables the scan API call will have a severe reduction in performance.
1. Set the imaging queue VisibilityTimeout attribute to 20 seconds 2. Set the imaging queue ReceiveMessageWaitTimeSeconds Attribute to 20 seconds 3. Access Mostly Uused Products by 50000+ Subscribers 4. Set the DelaySeconds parameter of a message to 20 seconds
1. Messages will be delivered exactly once and messages will be delievered in First in, First out order 2. Messages will be delivered exactly once and message delivery order is intermediate 3. Access Mostly Uused Products by 50000+ Subscribers 4. Messages will be delivered one or more times and message delivery order is intermediate
1. The reader will listen to the queue until a message is available or until timeout 2. If long polling is enabled, then each poll only polls a subset of SQS servers; in order for all messages to be received, polling must continuously occur 3. Access Mostly Uused Products by 50000+ Subscribers 4. Increases costs because each request lasts longer