Design a Database for a Mobile App

with Amazon DynamoDB

Introduction: Design a Database for a Mobile App with Amazon DynamoDB

Follow step-by-step instructions to learn advanced data modeling patterns in Amazon DynamoDB while building a DynamoDB-backed mobile application.

Overview

In this lab, you learn advanced data modeling patterns in Amazon DynamoDB while building a DynamoDB-backed mobile application. When using DynamoDB, it is important to consider how you will access your data (your access patterns) before you model your data. To learn these patterns, you build the data model for an example mobile application that includes a social network. You will learn how to design your data model in DynamoDB to achieve fast, consistent performance.

This lab assumes familiarity with basic DynamoDB concepts such as tables, items, primary keys, and secondary indexes. If you are unfamiliar with these concepts, see our lab about how to Create and Manage a Nonrelational Database with Amazon DynamoDB.

Why use DynamoDB for a mobile application?

DynamoDB is a popular choice for mobile applications because it is designed for high-scale use cases where consistent performance is critical as an application grows.

Some of the key reasons to use DynamoDB for your mobile application are:

  • Scalability: DynamoDB has no performance degradation as you scale to terabytes of data and beyond.
  • A simple, REST-based API: DynamoDB is accessible over HTTP(S) and uses AWS Identity and Access Management (IAM) for authentication.
  • Fully-managed: You don’t need to manage servers and apply patches to infrastructure. DynamoDB handles upgrades, backups, and other administrative tasks so that you can focus on developing your application.

 AWS Experience

Intermediate

 Time to Complete

180 minutes

 Cost to Complete

This tutorial will cost you less than $2 (assuming all services are running for 2 hours)*

 Tutorial Prereqs

Technologies used:

*This estimate assumes you follow the recommended configurations throughout the tutorial and terminate all resources within 2 hours.
**Accounts that have been created within the last 24 hours might not yet have access to the resources required for this project.

Modules

This tutorial is divided into five short modules. You must complete each module in order before moving on to the next one.

  1. Background and Setup (20 minutes): Configure your environment and download the code to follow along during the lab
  2. Plan Your Data Model (20 minutes): Build your entity-relationship diagram and map out your access patterns up front
  3. Core Usage: Users, Photos, Friends, and Reactions (40 minutes): Design the primary key and perform some basic actions
  4. Find Photo Reactions and a User's Followers (40 minutes): Learn about using an inverted index, a common design pattern for DynamoDB
  5. Partial Normalization (20 minutes): See how to use partial normalization and the BatchGetItem API call
  6. Add Reactions and Fellow Users (20 minutes): Use a DynamoDB transactions in two ways to handle complex operations
  7. Clean Up and Next Steps (20 minutes): Clean up the resources created in this lab

Was this page helpful?

Background and Setup