Book Image

Mastering DynamoDB

By : Tanmay Deshpande
Book Image

Mastering DynamoDB

By: Tanmay Deshpande

Overview of this book

Table of Contents (18 chapters)
Mastering DynamoDB
Credits
Foreword
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
8
Useful Libraries and Tools
Index

Modeling relationships


Like any other database, modeling relationships is quite interesting even though DynamoDB is a NoSQL database. Now that we have learned about the DynamoDB's data model, we can start looking at how to use them in your application. Most of the time, people get confused on how to model the relationships between various tables. In this section, we are trying to make an effort to simplify this problem.

Let's try to understand the relationships better using our example of the bookstore, where we have entities, such as book, author, publisher, and so on.

One to one

In this type of relationship, a one-entity record of a table is related to only a one-entity record of the other table. In our bookstore application, we have the BookInfo and BookDetails tables. The BookInfo table can have information in brief about the book, which can be used to display book information on web pages, whereas the BookDetails table would be used when someone explicitly needs to see all the details...