Utilising the AWS Console to Perform Read and Write Operations on DynamoDB for a Single Items
Published: 2023-08-15 22:05:48

In the realm of cloud computing, DynamoDB stands as one of the stalwarts, offering a powerful and flexible NoSQL database service. While you may not engage in reading and writing single items in DynamoDB on a regular basis, it holds significance as a valuable learning exercise and a practical demonstration of the system's capabilities. This article takes you through the process of utilising the AWS Console to achieve this task.

### Prerequisite: 
- AWS Account

#### Table Creation

- Accessing the AWS Console: Log in to your AWS account and navigate to the DynamoDB service.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kqnx6tw40ys5581gp50t.png)

- Creating a Table: Once in the DynamoDB dashboard, you'll spot the prominent "Create Table" button.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ckvoeak6fwre3hxlgf4h.png)

- Upon clicking it, you'll be prompted to define essential table details:

a. Table Name: Give your table a meaningful name.
b. Partition Key: Select the attribute that will serve as the partition key.
c. Remaining Settings: For this demonstration, you can leave the rest of the settings as default.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bkirw7cnqwezehadg7y8.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c2k9791lks9vdax53okp.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ar0y0zehoo59e4xg0iwm.png)


#### Item Creation

With the table in place, let's proceed to create a single item within it:

- Accessing Actions: After selecting your newly created table, navigate to the "Actions" button.

- Creating an Item: From the dropdown menu, choose "Create Item."


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rgzdnw110tl4f6itb3rd.png)

- JSON View Selection: On the ensuing "Create Item" page, you're presented with two view options: Form and JSON. For the purpose of this demonstration, we'll opt for the JSON view.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o4anc9qivf9i7ngd1cjh.png)

- Attributes Configuration: By unselecting the "Attributes" button, you're ready to configure your item's attributes using the JSON view.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dh9cw444icj7ymbgz8j6.png)

- JSON Configuration:
Update the JSON view with the following attribute values:

```
{
  "id": 1,
  "first_name": "Jack",
  "last_name": "Ma",
  "home_airport": "Beijing Daxing International Airport",
  "subscriber": true,
  "ip_address": "40.33.201.89",
  "last_flight": "8/18/2023"
}

```


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7k766mhfi3uza239m3bf.png)

- Item Creation: Click the "Create Item" button to initiate the creation process.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5opa16v5joucsoyf9vhf.png)

- Confirmation: Upon completion, verify that the item was successfully created.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ijfvtf44bbj060eky6z8.png)

#### Practical Implications

The ability to read and write single items in DynamoDB proves to be a versatile capability with various practical applications, particularly within CRUD (Create, Read, Update, Delete) operations. This process is invaluable when troubleshooting, rectifying records, generating test data, or designing new tables. However, it's important to recognise the context in which this technique is most suitable.

While this approach is ideal for scenarios where you need to populate a few records for testing or design purposes, it may not be the most practical option when dealing with large-scale data sets or performance testing. For such scenarios, more efficient methods are recommended.

In conclusion, the process of reading and writing single items in DynamoDB using the AWS Console serves as an insightful exercise that not only demonstrates the platform's functionality but also provides a foundational understanding of its capabilities. Whether you're exploring DynamoDB's features or preparing for more extensive data management tasks, this exercise proves to be an informative endeavour.