Build an Application Using a NoSQL Key-Value Data Store

GETTING STARTED GUIDE

Introduction

Follow step-by-step instructions to build an application using a NoSQL key-value data store.

Overview

In this tutorial, you will create a bookstore application that showcases a product catalog. Products typically contain unique identifiers and attributes such as descriptions, quantities, locations, and prices. The method for retrieving these types of attributes (specifically, the access pattern) is often a key-value lookup based on the product’s unique identifier. This means that an application can retrieve these other attributes when a product’s unique identifier is provided.

While the product catalog can start off with a few products, it should have the ability to scale to billions if needed without having to be re-architected or requiring a different database. It should also maintain fast, predictable performance at any scale for these key-value lookups. With these requirements in mind, Amazon DynamoDB is a good fit as the durable system of record for the bookstore because it offers low latency performance and scales as your application grows. Another benefit is that you do not need to manage any servers or clusters. You can also check out other purpose-built databases that meet these requirements in AWS Marketplace.

 AWS Experience

Beginner

 Time to Complete

70 minutes

 Cost to Complete

Free when using the AWS Free Tier

 Services used

Active AWS account,* Amazon DynamoDB, AWS Cloud9, AWS SDK for Python (Boto3)

*Accounts that have been created within the last 24 hours might not yet have access to the resources required for this project.

Initial Visualization

What You Will Learn

In this guide, you will learn how to:
 
  • build an application using a NoSQL key-value data store in DynamoDB
  • perform basic tasks, such as inserting and retrieving data 
  • use secondary indexes to enable additional query patterns
  • use the DynamoDB API to update attributes of existing items and remove items

Prerequisites

Before starting this guide, you will need:

  • An AWS account: If you don't already have one, follow the Setting Up Your Environment getting started guide for a quick overview.
  • An installed version of the AWS Python SDK via pip install boto3

Modules

This tutorial is divided into the following short modules. You must complete each module before moving to the next one.

  1. Application overview (15 minutes): Learn about the details of the application, and modeling a DynamoDB table to fit the requirements. 
  2. Inserting and retrieving data (15 minutes): We will create the table for our bookstore and insert and retrieve data.
  3. Querying and global secondary indexes (15 minutes): Learn how to use secondary indexes to enable additional query patterns on your DynamoDB tables. 
  4. Modifying items (15 minutes): Use the API to update attributes of existing items and remove items.
  5. Cleanup and next steps (10 minutes): Clean up the resources created in this project and learn more. 

Was this page helpful?

Application Overview