UserId of type string using AWS SDK for JavaScript v3?Option D correctly defines the primary key UserId as a string attribute with KeyType 'HASH'. Option D uses 'RANGE' which is for sort keys, not primary partition key. Option D wrongly sets attribute type to number. Option D uses binary type and PROVISIONED billing which is not required here.
PAY_PER_REQUEST charges you only for the reads and writes you actually perform, so no need to set capacity. PROVISIONED requires you to set how many reads and writes per second you expect, paying for that capacity whether you use it or not.
OrderId and CustomerId. Which option correctly defines the key schema for this composite primary key?Option A correctly sets OrderId as the partition key (HASH) and CustomerId as the sort key (RANGE). Option A reverses the keys but could be valid depending on design but here the question specifies unique by OrderId and CustomerId with OrderId first. Option A swaps HASH and RANGE incorrectly. Option A uses two HASH keys which is invalid.
Option B allows only the CreateTable action. Option B allows both create and delete, which is not restrictive. Option B denies delete but does not explicitly allow create, so user may not have create permission. Option B allows all DynamoDB actions, including delete.
Option C combines a high-cardinality attribute with a timestamp prefix, which helps distribute writes evenly and avoid hot partitions. Option C has low cardinality causing hot spots. Option C with increasing numbers causes sequential writes to one partition. Option C uses a fixed value, causing all writes to one partition, creating a hot partition.