Which statement best describes the main difference between NoSQL databases like DynamoDB and traditional relational databases?
Think about how data is organized and queried in each type.
Relational databases use fixed schemas and SQL for structured data, while NoSQL databases like DynamoDB use flexible schemas and store data as key-value or documents.
Given a DynamoDB table named Users with primary key UserID, what will be the output of this query?
SELECT * FROM Users WHERE UserID = '123'
Assuming the table has one item with UserID '123' and attributes Name: 'Alice', Age: 30.
Consider the data types and the query result format.
The query returns the item with UserID '123' including all attributes. The UserID is a string, Age is a number.
What error will this DynamoDB update expression cause?
UpdateExpression: "SET Age = Age + :val"
ExpressionAttributeValues: {":val": 1}Think about the data type of the attribute being updated.
If Age is not a number, DynamoDB will raise a ValidationException when trying to increment it.
You want to retrieve all items from a DynamoDB table with millions of records. Which approach is best to optimize performance and cost?
Consider how DynamoDB charges and performs scans vs queries.
Query operations with partition keys are efficient and cost-effective compared to full table scans.
Consider this SQL query:
SELECT Orders.OrderID, Customers.Name FROM Orders JOIN Customers ON Orders.CustomerID = Customers.CustomerID;
Why will this query fail or not work as expected in DynamoDB?
Think about how NoSQL databases handle relationships compared to relational databases.
DynamoDB does not support SQL JOINs. Data relationships must be handled by denormalizing data or joining in application logic.