Book Image

DynamoDB Applied Design Patterns

By : Uchit Hamendra Vyas
Book Image

DynamoDB Applied Design Patterns

By: Uchit Hamendra Vyas

Overview of this book

Table of Contents (17 chapters)
DynamoDB Applied Design Patterns
About the Authors
About the Reviewers


This book, DynamoDB Applied Design Patterns, will be a single place to find solutions for all hiccups with Amazon DynamoDB. This book will explain how to create, design, and manage databases in DynamoDB using the AWS SDKs and APIs, as well as the AWS management console, a browser-based graphical user interface to interact with the service. It will include a significant number of examples that can be used by anyone, from a newbie to an expert. Using this book, users can perform advanced-level programming and gain the advantages of AWS DynamoDB NoSQL databases in their application at significantly lower costs.

What this book covers

Chapter 1, Data Modeling with DynamoDB, will teach users about data model concepts, including tables, items and attributes, primary key, and indexes and their design patterns.

Chapter 2, DynamoDB Interfaces, will help users gain knowledge of how to access DynamoDB in the management console. We will also take a look at the command-line interface and the Eclipse plugin.

Chapter 3, Tools and Libraries of AWS DynamoDB, will teach users what DynamoDB Local is, what the CLI commands are, and how we can use CLI from a developer/DBA perspective.

Chapter 4, Working with Secondary Indexes, will teach users what global and local secondary indexes are and what the importance of secondary indexes in DynamoDB is. Users will learn managed auto-sharding NoSQL databases that automatically reshard based on SLA.

Chapter 5, Query and Scan Operations in DynamoDB, will teach users about parallel scanning operations for DynamoDB. Users will learn how to use query and scan operations on DynamoDB tables and how to get results from query and scan operations.

Chapter 6, Working with the DynamoDB API, will take users through the Amazon DynamoDB API and its format. Users will learn how to call an API from applications to DynamoDB and how to retrieve data in an appropriate format that can be used with applications.

Chapter 7, Distributed Locking with DynamoDB, will provide readers with the information to support DynamoDB as an excellent choice for a distributed locking service, while briefly exploring the what, why, and how of locking.

Chapter 8, DynamoDB with Redshift, Data Pipeline, and MapReduce, will help readers work closely with DynamoDB from Redshift, S3, and MapReduce, and we will learn how to collaborate these AWS services with DynamoDB efficiently.

Chapter 9, DynamoDB – Best Practices, will help readers to deep dive into the best design use case architectures for DynamoDB. They will also learn real-time problem statements and their best solutions.

Appendix, Comparing DynamoDB, will teach users how Amazon DynamoDB is different than other NoSQL databases. So from that comparison, users will come to know the importance of DynamoDB while they are deploying their application with a NoSQL database.

What you need for this book

To start using this book, you need the following things:

  • An AWS account

  • JAVA 1.6 or higher

  • Eclipse (Juno, Indigo, or Kepler)


  • AWS CLI tools

Who this book is for

This book will be ideal for competent DynamoDB developers, architects, and DevOps. The reader should have a basic knowledge and understanding of AWS and different databases to allow efficient programming of core elements and applications with DynamoDB.


In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Therefore, during the creation of the Tbl_Book table in DynamoDB, we will specify only the BookTitle and Author attributes."

A block of code is set as follows:

aws dynamodb create-table --table-name Tbl_Book
--attribute-definitions AttributeName=BookTitle,AttributeType=S AttributeName=Author,AttributeType=S --key-schema AttributeName=BookTitle,KeyType=HASH AttributeName=Author,KeyType=RANGE 
--provisioned-throughput ReadCapacityUnits=2,WriteCapacityUnits=2

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

ScanRequest scanRequest = new ScanRequest()
ScanResult result = client.scan(scanRequest);

Any command-line input or output is written as follows:

copytable_uchitredshift from 'dynamodb:// table_uchitdynamodb' 
credentials 'aws_access_key_id=xxxxx;aws_secret_access_key=xxx' 
readratio 50;

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "To view the inserted item, click on the Browse Items tab, select the Scan radio button, and click on the Go button."


Warnings or important notes appear in a box like this.


Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.


Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from


Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.


You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.