You are previewing DynamoDB Cookbook.
O'Reilly logo
DynamoDB Cookbook

Book Description

Over 90 hands-on recipes to design Internet scalable web and mobile applications with Amazon DynamoDB

About This Book

  • Construct top-notch mobile and web applications with the Internet scalable NoSQL database and host it on cloud

  • Integrate your applications with other AWS services like AWS EMR, AWS S3, AWS Redshift, and AWS CloudSearch etc. in order to achieve a one-stop application stack

  • Step-by-step implementation guide that provides real-world use with hands-on recipes

  • Who This Book Is For

    This book is intended for those who have a basic understanding of AWS services and want to take their knowledge to the next level by getting their hands dirty with coding recipes in DynamoDB.

    What You Will Learn

  • Design DynamoDB tables to achieve high read and write throughput

  • Discover best practices like caching, exponential back-offs and auto-retries, storing large items in AWS S3, storing compressed data etc.

  • Effectively use DynamoDB Local in order to make your development smooth and cost effective

  • Implement cost effective best practices to reduce the burden of DynamoDB charges

  • Create and maintain secondary indexes to support improved data access

  • Integrate various other AWS services like AWS EMR, AWS CloudSearch, AWS Pipeline etc. with DynamoDB

  • In Detail

    AWS DynamoDB is an excellent example of a production-ready NoSQL database. In recent years, DynamoDB has been able to attract many customers because of its features like high-availability, reliability and infinite scalability. DynamoDB can be easily integrated with massive data crunching tools like Hadoop /EMR, which is an essential part of this data-driven world and hence it is widely accepted. The cost and time-efficient design makes DynamoDB stand out amongst its peers. The design of DynamoDB is so neat and clean that it has inspired many NoSQL databases to simply follow it.

    This book will get your hands on some engineering best practices DynamoDB engineers use, which can be used in your day-to-day life to build robust and scalable applications. You will start by operating with DynamoDB tables and learn to manipulate items and manage indexes. You will also discover how to easily integrate applications with other AWS services like EMR, S3, CloudSearch, RedShift etc. A couple of chapters talk in detail about how to use DynamoDB as a backend database and hosting it on AWS ElasticBean. This book will also focus on security measures of DynamoDB as well by providing techniques on data encryption, masking etc.

    By the end of the book you'll be adroit in designing web and mobile applications using DynamoDB and host it on cloud.

    Style and approach

    An easy-to-follow guide, full of real-world examples, which takes you through the world of DynamoDB following a step-by-step, problem-solution based approach.

    Downloading the example code for this book You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

    Table of Contents

    1. DynamoDB Cookbook
      1. Table of Contents
      2. DynamoDB Cookbook
      3. Credits
      4. About the Author
      5. Acknowledgments
      6. About the Reviewers
      7. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
      8. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Sections
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Conventions
        6. Reader feedback
        7. Customer support
          1. Downloading the example code
          2. Downloading the color images of this book
          3. Errata
          4. Piracy
          5. Questions
      9. 1. Taking Your First Steps with DynamoDB
        1. Introduction
        2. Signing up to the DynamoDB console
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        3. Creating the DynamoDB table using the console
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        4. Loading data into the table using the console
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Querying data using the DynamoDB console
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Deleting the DynamoDB table using the console
          1. Getting ready
          2. How to do it…
          3. How it works…
        7. Analyzing DynamoDB metric on CloudWatch
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        8. Downloading and setting up DynamoDB Local
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        9. Using DynamoDB Local JavaScript Shell
          1. Getting ready
          2. How to do it…
          3. How it works…
        10. Setting up AWS Command Line Interface for DynamoDB
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        11. Setting up the Eclipse IDE
          1. Getting ready
          2. How to do it…
          3. How it works…
      10. 2. Operating with DynamoDB Tables
        1. Introduction
        2. Creating a table using the AWS SDK for Java
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        3. Creating a table using the AWS SDK for .Net
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Creating a table using the AWS SDK for PHP
          1. Getting ready…
          2. How to do it…
          3. How it works…
        5. Updating a table using the AWS SDK for Java
          1. Getting ready…
          2. How to do it…
          3. How it works…
        6. Updating a table using the AWS SDK for .Net
          1. Getting ready
          2. How to do it…
          3. How it works…
        7. Updating a table using the AWS SDK for PHP
          1. Getting ready
          2. How to do it…
          3. How it works…
        8. Listing tables using the AWS SDK for Java
          1. Getting ready
          2. How to do it…
          3. How it works…
        9. Listing tables using the AWS SDK for .Net
          1. Getting ready
          2. How to do it…
          3. How it works…
        10. Listing tables using the AWS SDK for PHP
          1. Getting ready
          2. How to do it…
          3. How it works…
        11. Deleting a table using the AWS SDK for Java
          1. Getting ready
          2. How to do it…
          3. How it works…
        12. Deleting a table using the AWS SDK for .Net
          1. Getting ready
          2. How to do it…
          3. How it works…
        13. Deleting a table using the AWS SDK for PHP
          1. Getting ready
          2. How to do it…
          3. How it works…
      11. 3. Manipulating DynamoDB Items
        1. Introduction
        2. Putting an item into the DynamoDB table using the AWS SDK for Java
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        3. Putting an item into the DynamoDB table using the AWS SDK for .Net
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Putting an item into the DynamoDB table using the AWS SDK for PHP
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Getting an item from the DynamoDB table using the AWS SDK for Java
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Getting an item from the DynamoDB table using the AWS SDK for .Net
          1. Getting ready
          2. How to do it…
          3. How it works…
        7. Getting an item from the DynamoDB table using the AWS SDK for PHP
          1. Getting ready
          2. How to do it…
          3. How it works…
        8. Updating an item in the DynamoDB table using the AWS SDK for Java
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        9. Updating an item in the DynamoDB table using the AWS SDK for .Net
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        10. Updating an item in the DynamoDB table using the AWS SDK for PHP
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        11. Deleting an item from the DynamoDB table using the AWS SDK for Java
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        12. Deleting an item from the DynamoDB table using the AWS SDK for .Net
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        13. Deleting an item from the DynamoDB table using the AWS SDK for PHP
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        14. Getting multiple items using the AWS SDK for Java
          1. Getting ready
          2. How to do it
          3. How it works…
        15. Getting multiple items using the AWS SDK for .Net
          1. Getting ready
          2. How to do it…
          3. How it works…
        16. Getting multiple items using the AWS SDK for PHP
          1. Getting ready…
          2. How to do it…
          3. How it works…
        17. Batch write operations using the AWS SDK for Java
          1. Getting ready
          2. How to do it…
          3. How it works…
        18. Batch write operations using the AWS SDK for .Net
          1. Getting ready
          2. How to do it…
          3. How it works…
        19. Batch write operations using the AWS SDK for PHP
          1. Getting ready
          2. How to do it…
          3. How it works…
      12. 4. Managing DynamoDB Indexes
        1. Introduction
        2. Creating a DynamoDB table with a Global Secondary Index using the AWS SDK for Java
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Creating a DynamoDB table with a Global Secondary Index using the AWS SDK for .Net
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Creating a DynamoDB table with a Global Secondary Index using the AWS SDK for PHP
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Querying a Global Secondary Index using the AWS SDK for Java
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Querying a Global Secondary Index using the AWS SDK for .Net
          1. Getting ready
          2. How to do it…
          3. How it works…
        7. Querying a Global Secondary Index using the AWS SDK for PHP
          1. Getting ready
          2. How to do it…
          3. How it works…
        8. Creating a DynamoDB table with a Local Secondary Index using the AWS SDK for Java
          1. Getting ready
          2. How to do it…
          3. How it works…
        9. Creating a DynamoDB table with a Local Secondary Index using the AWS SDK for .Net
          1. Getting ready
          2. How to do it…
          3. How it works…
        10. Creating a DynamoDB table with a Local Secondary Index using the AWS SDK for PHP
          1. Getting ready
          2. How to do it…
          3. How it works…
        11. Querying a Local Secondary Index using the AWS SDK for Java
          1. Getting ready
          2. How to do it…
          3. How it works…
        12. Querying a Local Secondary Index using the AWS SDK for .Net
          1. Getting ready
          2. How to do it…
          3. How it works…
        13. Querying a Local Secondary Index using the AWS SDK for PHP
          1. Getting ready
          2. How to do it…
          3. How it works…
        14. Using a Global Secondary Index for quick lookups
          1. Getting ready
          2. How to do it…
          3. How it works…
      13. 5. Exploring Higher Level Programming Interfaces for DynamoDB
        1. Introduction
        2. Creating a data model for the DynamoDB item using the object persistence model in Java
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Putting items into the DynamoDB table using the object persistence model in Java
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Retrieving items from the DynamoDB table using the object persistence model in Java
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Creating a custom object for the DynamoDB table using the object persistence model in Java
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Querying items from the DynamoDB table using the object persistence model in Java
          1. Getting ready
          2. How to do it…
          3. How it works…
        7. Scanning items from the DynamoDB table using the object persistence model in Java
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        8. Saving items into the DynamoDB table using the object persistence model in .Net
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There is more…
        9. Retrieving items from the DynamoDB table using the object persistence model in .Net
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There is more…
        10. Creating a custom object for the DynamoDB table using the object persistence model in .Net
          1. Getting ready
          2. How to do it…
          3. How it works…
        11. Querying items from the DynamoDB table using the object persistence model in .Net
          1. Getting ready
          2. How to do it…
          3. How it works…
        12. Scanning items from the DynamoDB table using the object persistence model in .Net
          1. Getting ready
          2. How to do it…
          3. How it works…
      14. 6. Securing DynamoDB
        1. Introduction
        2. Creating users using AWS IAM
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Creating a DynamoDB full access group using AWS IAM
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Creating a DynamoDB read-only group using AWS IAM
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Validating the DynamoDB access controls using the AWS IAM policy simulator
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Creating the custom policy to allow the DynamoDB console access using AWS IAM
          1. Getting ready
          2. How to do it…
          3. How it works…
        7. Creating a fine-grained access control policy using AWS IAM
          1. Getting ready
          2. How to do it…
          3. How it works…
        8. Implementing the client-side encryption for the DynamoDB data
          1. Getting ready
          2. How to do it…
          3. How it works…
        9. Implementing the client-side masking for the DynamoDB data
          1. Getting ready
          2. How to do it…
          3. How it works…
      15. 7. DynamoDB Best Practices
        1. Introduction
        2. Using a standalone cache for frequently accessed items
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Using the AWS ElastiCache for frequently accessed items
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Compressing large data before storing it in DynamoDB
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Using AWS S3 for storing large items
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Catching DynamoDB errors
          1. Getting ready
          2. How to do it…
          3. How it works…
        7. Performing auto-retries on DynamoDB errors
          1. Getting ready
          2. How to do it…
          3. How it works…
        8. Performing atomic transactions on DynamoDB tables
          1. Getting ready
          2. How to do it…
          3. How it works…
        9. Performing asynchronous requests to DynamoDB
          1. Getting ready
          2. How to do it…
          3. How it works
      16. 8. Integrating DynamoDB with other AWS Services
        1. Introduction
        2. Importing data from AWS S3 to DynamoDB using AWS Data Pipeline
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Exporting data from AWS S3 to DynamoDB using AWS Data Pipeline
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Accessing the DynamoDB data using AWS EMR
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Querying the DynamoDB data using AWS EMR
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Performing join operations on the DynamoDB data using AWS EMR
          1. Getting ready
          2. How to do it…
          3. How it works…
        7. Exporting data to AWS S3 from DynamoDB using AWS EMR
          1. Getting ready
          2. How to do it…
          3. How it works…
        8. Logging DynamoDB operations using AWS CloudTrail
          1. Getting ready
          2. How to do it…
          3. How it works…
        9. Exporting the DynamoDB data to AWS Redshift
          1. Getting ready
          2. How to do it…
          3. How it works…
        10. Importing the DynamoDB data to AWS CloudSearch
          1. Getting ready
          2. How to do it…
          3. How it works…
        11. Performing a full text search on the DynamoDB data using CloudSearch
          1. Getting ready
          2. How to do it…
          3. How it works…
      17. 9. Developing Web Applications using DynamoDB
        1. Introduction
        2. Performing data modeling and table creations
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Developing services for the sign-up activity for web applications
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Developing services for the sign-in activity for web applications
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Developing services for the Address Book application
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Deploying web applications on AWS Elastic Beanstalk
          1. Getting ready
          2. How to do it…
          3. How it works…
      18. 10. Developing Mobile Applications using DynamoDB
        1. Introduction
        2. Performing data modeling and table creation
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Creating an identity pool using AWS Cognito
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Creating the access policy and applying it to the AWS Cognito role
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Implementing user registration services
          1. Getting ready…
          2. How to do it…
          3. How it works…
        6. Implementing user login services
          1. Getting ready…
          2. How to do it…
          3. How it works…
        7. Implementing add new contact services
          1. Getting ready…
          2. How to do it…
          3. How it works…
        8. Implementing view contacts services
          1. Getting ready…
          2. How to do it…
          3. How it works…
      19. Index