0
0
DynamoDBquery~30 mins

DynamoDB vs MongoDB vs Cassandra - Hands-On Comparison

Choose your learning style9 modes available
Comparing DynamoDB, MongoDB, and Cassandra with Sample Queries
📖 Scenario: You are working as a junior database analyst for a company that wants to understand how three popular NoSQL databases work: DynamoDB, MongoDB, and Cassandra. You will create simple data structures and queries to see how each database handles data storage and retrieval.
🎯 Goal: Build simple data entries and queries in DynamoDB style to compare with MongoDB and Cassandra concepts. You will create a table, add a configuration for querying, write a query to retrieve data, and finalize the setup.
📋 What You'll Learn
Create a DynamoDB table structure with exact attribute names and values
Add a configuration variable for query filtering
Write a query expression to retrieve items based on the configuration
Complete the table setup with a key schema and provisioned throughput
💡 Why This Matters
🌍 Real World
Understanding how different NoSQL databases store and query data helps in choosing the right database for applications like user management, product catalogs, or real-time analytics.
💼 Career
Database developers and data engineers often need to work with multiple NoSQL databases and write queries or configurations that fit the application's needs.
Progress0 / 4 steps
1
Create a DynamoDB table with sample items
Create a variable called table_items as a list of dictionaries. Add exactly two items with these attributes: {'UserID': 'user1', 'Name': 'Alice', 'Age': 30} and {'UserID': 'user2', 'Name': 'Bob', 'Age': 25}.
DynamoDB
Need a hint?

Use a list with two dictionaries exactly as shown, with keys 'UserID', 'Name', and 'Age'.

2
Add a filter configuration for querying
Create a variable called age_filter and set it to the integer 28. This will be used to filter users older than this age.
DynamoDB
Need a hint?

Just assign the number 28 to the variable age_filter.

3
Write a query to select users older than the filter
Create a variable called filtered_users that uses a list comprehension to select items from table_items where the 'Age' is greater than age_filter.
DynamoDB
Need a hint?

Use a list comprehension filtering by item['Age'] > age_filter.

4
Complete the DynamoDB table setup with key schema and throughput
Create a dictionary called table_config with keys: 'TableName' set to 'Users', 'KeySchema' set to a list with one dictionary {'AttributeName': 'UserID', 'KeyType': 'HASH'}, and 'ProvisionedThroughput' set to {'ReadCapacityUnits': 5, 'WriteCapacityUnits': 5}.
DynamoDB
Need a hint?

Follow the exact dictionary structure with keys and nested lists/dictionaries as shown.