Book Image

DynamoDB Cookbook

By : Tanmay Deshpande
Book Image

DynamoDB Cookbook

By: Tanmay Deshpande

Overview of this book

Table of Contents (18 chapters)
DynamoDB Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Developing services for the sign-up activity for web applications


In the earlier recipe, we created DynamoDB tables based on the need. Now, we will write services to put the data into DynamoDB and get the data back for our application. In this recipe, we will learn how to write services for the sign-up/user registration activity.

Getting ready

To get started with this recipe, you need to know to use the AWS SDK for DynamoDB.

How to do it…

Let's write services to put the data into DynamoDB:

  1. To get started, we will first create a maven project and add the AWS SDK:

    dependency:<dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>aws-java-sdk-dynamodb</artifactId>
      <version>1.10.4.1</version>
    </dependency>
  2. Next, we will create a model class for the user table. Here, we will use the DynamoDBMapper class to connect to DynamoDB using Object Persistence Model. We will also consider attributes, such as the first name, last name, password, and so on...