Welcome back! In our previous discussions, we've explored the essentials of setting up DynamoDB tables and the key concepts behind AWS's NoSQL database service. Today, we dive into the practical aspects of DynamoDB by learning how to add data to our tables. We'll focus on using the PutItem
and BatchWriteItem
operations to insert single and multiple items, respectively.
Our practical examples will utilize a Students
table, structured with the following attributes: student_id
(serving as the primary key), name
, age
, and major
. Here's a quick glance at the existing data setup:
This session aims to expand this table by adding more student records, allowing us to apply our learning in a hands-on manner. Let's get started by adding new entries and examining how DynamoDB handles these data manipulation tasks.
Let's start by adding a new student, John, who is studying Physics, to our Students
table. To do this, we'll use the operation, which is designed for creating a single item within your DynamoDB table. Here's how you can add John's details:
