0
0
AWScloud~30 mins

Put, get, and query operations in AWS - Mini Project: Build & Apply

Choose your learning style9 modes available
Put, get, and query operations
📖 Scenario: You are building a simple cloud database to store and retrieve user profiles. Each profile has a unique user ID, a name, and an email address. You will create the data structure, configure a key for queries, add data, and then retrieve data using put, get, and query operations.
🎯 Goal: Build a simple AWS DynamoDB table setup with put, get, and query operations to store and retrieve user profiles by user ID.
📋 What You'll Learn
Create a DynamoDB table named UserProfiles with UserID as the primary key
Add a configuration variable for the table name
Write a put operation to add a user profile with UserID, Name, and Email
Write a get operation to retrieve a user profile by UserID
Write a query operation to find user profiles by UserID
💡 Why This Matters
🌍 Real World
Cloud databases like DynamoDB are used to store user data for web and mobile apps. Knowing how to put, get, and query data is essential for building responsive applications.
💼 Career
These operations are fundamental skills for cloud engineers, backend developers, and anyone working with AWS cloud services.
Progress0 / 4 steps
1
Create DynamoDB table data structure
Create a dictionary called table_definition that defines a DynamoDB table named UserProfiles with a primary key attribute called UserID of type string.
AWS
Need a hint?

Think of table_definition as a blueprint for your database table. You need to specify the table name and the key structure.

2
Add configuration variable for table name
Create a variable called table_name and set it to the string 'UserProfiles'.
AWS
Need a hint?

This variable will help you refer to the table easily in your code.

3
Write put operation to add a user profile
Write a dictionary called put_item that represents a DynamoDB put operation to add a user profile with UserID set to 'user123', Name set to 'Alice', and Email set to 'alice@example.com'.
AWS
Need a hint?

Use the Item key to specify the data you want to add. Each attribute needs its type specified as 'S' for string.

4
Write get and query operations to retrieve user profile
Write two dictionaries: get_item to get a user profile by UserID set to 'user123', and query_item to query the table for items where UserID equals 'user123'.
AWS
Need a hint?

Use Key for get operations and KeyConditionExpression with ExpressionAttributeValues for query operations.