Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

DynamoDB Cookbook
DynamoDB Cookbook
DynamoDB Cookbook
Ebook704 pages1 hour

DynamoDB Cookbook

Rating: 0 out of 5 stars

()

Read preview

About this ebook

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.
LanguageEnglish
Release dateSep 25, 2015
ISBN9781784391096
DynamoDB Cookbook

Read more from Deshpande Tanmay

Related to DynamoDB Cookbook

Related ebooks

Internet & Web For You

View More

Related articles

Reviews for DynamoDB Cookbook

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    DynamoDB Cookbook - Deshpande Tanmay

    Table of Contents

    DynamoDB Cookbook

    Credits

    About the Author

    Acknowledgments

    About the Reviewers

    www.PacktPub.com

    Support files, eBooks, discount offers, and more

    Why subscribe?

    Free access for Packt account holders

    Preface

    What this book covers

    What you need for this book

    Who this book is for

    Sections

    Getting ready

    How to do it…

    How it works…

    There's more…

    See also

    Conventions

    Reader feedback

    Customer support

    Downloading the example code

    Downloading the color images of this book

    Errata

    Piracy

    Questions

    1. Taking Your First Steps with DynamoDB

    Introduction

    Signing up to the DynamoDB console

    Getting ready

    How to do it…

    How it works…

    There's more…

    Creating the DynamoDB table using the console

    Getting ready

    How to do it…

    How it works…

    There's more…

    Loading data into the table using the console

    Getting ready

    How to do it…

    How it works…

    Querying data using the DynamoDB console

    Getting ready

    How to do it…

    How it works…

    Deleting the DynamoDB table using the console

    Getting ready

    How to do it…

    How it works…

    Analyzing DynamoDB metric on CloudWatch

    Getting ready

    How to do it…

    How it works…

    There's more…

    Downloading and setting up DynamoDB Local

    Getting ready

    How to do it…

    How it works…

    There's more…

    Using DynamoDB Local JavaScript Shell

    Getting ready

    How to do it…

    How it works…

    Setting up AWS Command Line Interface for DynamoDB

    Getting ready

    How to do it…

    How it works…

    There's more…

    Setting up the Eclipse IDE

    Getting ready

    How to do it…

    How it works…

    2. Operating with DynamoDB Tables

    Introduction

    Creating a table using the AWS SDK for Java

    Getting ready

    How to do it…

    How it works…

    There's more…

    Creating a table using the AWS SDK for .Net

    Getting ready

    How to do it…

    How it works…

    Creating a table using the AWS SDK for PHP

    Getting ready…

    How to do it…

    How it works…

    Updating a table using the AWS SDK for Java

    Getting ready…

    How to do it…

    How it works…

    Updating a table using the AWS SDK for .Net

    Getting ready

    How to do it…

    How it works…

    Updating a table using the AWS SDK for PHP

    Getting ready

    How to do it…

    How it works…

    Listing tables using the AWS SDK for Java

    Getting ready

    How to do it…

    How it works…

    Listing tables using the AWS SDK for .Net

    Getting ready

    How to do it…

    How it works…

    Listing tables using the AWS SDK for PHP

    Getting ready

    How to do it…

    How it works…

    Deleting a table using the AWS SDK for Java

    Getting ready

    How to do it…

    How it works…

    Deleting a table using the AWS SDK for .Net

    Getting ready

    How to do it…

    How it works…

    Deleting a table using the AWS SDK for PHP

    Getting ready

    How to do it…

    How it works…

    3. Manipulating DynamoDB Items

    Introduction

    Putting an item into the DynamoDB table using the AWS SDK for Java

    Getting ready

    How to do it…

    How it works…

    There's more…

    Putting an item into the DynamoDB table using the AWS SDK for .Net

    Getting ready

    How to do it…

    How it works…

    Putting an item into the DynamoDB table using the AWS SDK for PHP

    Getting ready

    How to do it…

    How it works…

    Getting an item from the DynamoDB table using the AWS SDK for Java

    Getting ready

    How to do it…

    How it works…

    Getting an item from the DynamoDB table using the AWS SDK for .Net

    Getting ready

    How to do it…

    How it works…

    Getting an item from the DynamoDB table using the AWS SDK for PHP

    Getting ready

    How to do it…

    How it works…

    Updating an item in the DynamoDB table using the AWS SDK for Java

    Getting ready

    How to do it…

    How it works…

    There's more…

    Updating an item in the DynamoDB table using the AWS SDK for .Net

    Getting ready

    How to do it…

    How it works…

    There's more…

    Updating an item in the DynamoDB table using the AWS SDK for PHP

    Getting ready

    How to do it…

    How it works…

    There's more…

    Deleting an item from the DynamoDB table using the AWS SDK for Java

    Getting ready

    How to do it…

    How it works…

    There's more…

    Deleting an item from the DynamoDB table using the AWS SDK for .Net

    Getting ready

    How to do it…

    How it works…

    There's more…

    Deleting an item from the DynamoDB table using the AWS SDK for PHP

    Getting ready

    How to do it…

    How it works…

    There's more…

    Getting multiple items using the AWS SDK for Java

    Getting ready

    How to do it

    How it works…

    Getting multiple items using the AWS SDK for .Net

    Getting ready

    How to do it…

    How it works…

    Getting multiple items using the AWS SDK for PHP

    Getting ready…

    How to do it…

    How it works…

    Batch write operations using the AWS SDK for Java

    Getting ready

    How to do it…

    How it works…

    Batch write operations using the AWS SDK for .Net

    Getting ready

    How to do it…

    How it works…

    Batch write operations using the AWS SDK for PHP

    Getting ready

    How to do it…

    How it works…

    4. Managing DynamoDB Indexes

    Introduction

    Creating a DynamoDB table with a Global Secondary Index using the AWS SDK for Java

    Getting ready

    How to do it…

    How it works…

    Creating a DynamoDB table with a Global Secondary Index using the AWS SDK for .Net

    Getting ready

    How to do it…

    How it works…

    Creating a DynamoDB table with a Global Secondary Index using the AWS SDK for PHP

    Getting ready

    How to do it…

    How it works…

    Querying a Global Secondary Index using the AWS SDK for Java

    Getting ready

    How to do it…

    How it works…

    Querying a Global Secondary Index using the AWS SDK for .Net

    Getting ready

    How to do it…

    How it works…

    Querying a Global Secondary Index using the AWS SDK for PHP

    Getting ready

    How to do it…

    How it works…

    Creating a DynamoDB table with a Local Secondary Index using the AWS SDK for Java

    Getting ready

    How to do it…

    How it works…

    Creating a DynamoDB table with a Local Secondary Index using the AWS SDK for .Net

    Getting ready

    How to do it…

    How it works…

    Creating a DynamoDB table with a Local Secondary Index using the AWS SDK for PHP

    Getting ready

    How to do it…

    How it works…

    Querying a Local Secondary Index using the AWS SDK for Java

    Getting ready

    How to do it…

    How it works…

    Querying a Local Secondary Index using the AWS SDK for .Net

    Getting ready

    How to do it…

    How it works…

    Querying a Local Secondary Index using the AWS SDK for PHP

    Getting ready

    How to do it…

    How it works…

    Using a Global Secondary Index for quick lookups

    Getting ready

    How to do it…

    How it works…

    5. Exploring Higher Level Programming Interfaces for DynamoDB

    Introduction

    Creating a data model for the DynamoDB item using the object persistence model in Java

    Getting ready

    How to do it…

    How it works…

    Putting items into the DynamoDB table using the object persistence model in Java

    Getting ready

    How to do it…

    How it works…

    Retrieving items from the DynamoDB table using the object persistence model in Java

    Getting ready

    How to do it…

    How it works…

    Creating a custom object for the DynamoDB table using the object persistence model in Java

    Getting ready

    How to do it…

    How it works…

    Querying items from the DynamoDB table using the object persistence model in Java

    Getting ready

    How to do it…

    How it works…

    Scanning items from the DynamoDB table using the object persistence model in Java

    Getting ready

    How to do it…

    How it works…

    There's more…

    Saving items into the DynamoDB table using the object persistence model in .Net

    Getting ready

    How to do it…

    How it works…

    There is more…

    Retrieving items from the DynamoDB table using the object persistence model in .Net

    Getting ready

    How to do it…

    How it works…

    There is more…

    Creating a custom object for the DynamoDB table using the object persistence model in .Net

    Getting ready

    How to do it…

    How it works…

    Querying items from the DynamoDB table using the object persistence model in .Net

    Getting ready

    How to do it…

    How it works…

    Scanning items from the DynamoDB table using the object persistence model in .Net

    Getting ready

    How to do it…

    How it works…

    6. Securing DynamoDB

    Introduction

    Creating users using AWS IAM

    Getting ready

    How to do it…

    How it works…

    Creating a DynamoDB full access group using AWS IAM

    Getting ready

    How to do it…

    How it works…

    Creating a DynamoDB read-only group using AWS IAM

    Getting ready

    How to do it…

    How it works…

    Validating the DynamoDB access controls using the AWS IAM policy simulator

    Getting ready

    How to do it…

    How it works…

    Creating the custom policy to allow the DynamoDB console access using AWS IAM

    Getting ready

    How to do it…

    How it works…

    Creating a fine-grained access control policy using AWS IAM

    Getting ready

    How to do it…

    How it works…

    Implementing the client-side encryption for the DynamoDB data

    Getting ready

    How to do it…

    How it works…

    Implementing the client-side masking for the DynamoDB data

    Getting ready

    How to do it…

    How it works…

    7. DynamoDB Best Practices

    Introduction

    Using a standalone cache for frequently accessed items

    Getting ready

    How to do it…

    How it works…

    Using the AWS ElastiCache for frequently accessed items

    Getting ready

    How to do it…

    How it works…

    Compressing large data before storing it in DynamoDB

    Getting ready

    How to do it…

    How it works…

    Using AWS S3 for storing large items

    Getting ready

    How to do it…

    How it works…

    Catching DynamoDB errors

    Getting ready

    How to do it…

    How it works…

    Performing auto-retries on DynamoDB errors

    Getting ready

    How to do it…

    How it works…

    Performing atomic transactions on DynamoDB tables

    Getting ready

    How to do it…

    How it works…

    Performing asynchronous requests to DynamoDB

    Getting ready

    How to do it…

    How it works

    8. Integrating DynamoDB with other AWS Services

    Introduction

    Importing data from AWS S3 to DynamoDB using AWS Data Pipeline

    Getting ready

    How to do it…

    How it works…

    Exporting data from AWS S3 to DynamoDB using AWS Data Pipeline

    Getting ready

    How to do it…

    How it works…

    Accessing the DynamoDB data using AWS EMR

    Getting ready

    How to do it…

    How it works…

    Querying the DynamoDB data using AWS EMR

    Getting ready

    How to do it…

    How it works…

    Performing join operations on the DynamoDB data using AWS EMR

    Getting ready

    How to do it…

    How it works…

    Exporting data to AWS S3 from DynamoDB using AWS EMR

    Getting ready

    How to do it…

    How it works…

    Logging DynamoDB operations using AWS CloudTrail

    Getting ready

    How to do it…

    How it works…

    Exporting the DynamoDB data to AWS Redshift

    Getting ready

    How to do it…

    How it works…

    Importing the DynamoDB data to AWS CloudSearch

    Getting ready

    How to do it…

    How it works…

    Performing a full text search on the DynamoDB data using CloudSearch

    Getting ready

    How to do it…

    How it works…

    9. Developing Web Applications using DynamoDB

    Introduction

    Performing data modeling and table creations

    Getting ready

    How to do it…

    How it works…

    Developing services for the sign-up activity for web applications

    Getting ready

    How to do it…

    How it works…

    Developing services for the sign-in activity for web applications

    Getting ready

    How to do it…

    How it works…

    Developing services for the Address Book application

    Getting ready

    How to do it…

    How it works…

    Deploying web applications on AWS Elastic Beanstalk

    Getting ready

    How to do it…

    How it works…

    10. Developing Mobile Applications using DynamoDB

    Introduction

    Performing data modeling and table creation

    Getting ready

    How to do it…

    How it works…

    Creating an identity pool using AWS Cognito

    Getting ready

    How to do it…

    How it works…

    Creating the access policy and applying it to the AWS Cognito role

    Getting ready

    How to do it…

    How it works…

    Implementing user registration services

    Getting ready…

    How to do it…

    How it works…

    Implementing user login services

    Getting ready…

    How to do it…

    How it works…

    Implementing add new contact services

    Getting ready…

    How to do it…

    How it works…

    Implementing view contacts services

    Getting ready…

    How to do it…

    How it works…

    Index

    DynamoDB Cookbook


    DynamoDB Cookbook

    Copyright © 2015 Packt Publishing

    All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form, or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

    Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author nor Packt Publishing, and its dealers and distributors, will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

    Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

    First published: September 2015

    Production reference: 1210915

    Published by Packt Publishing Ltd.

    Livery Place

    35 Livery Street

    Birmingham B3 2PB, UK.

    ISBN 978-1-78439-375-5

    www.packtpub.com

    Credits

    Author

    Tanmay Deshpande

    Reviewers

    Sergio Alcantara

    Kenny Ha

    Volker Kueffel

    Dr. Jun-young Kwak

    Commissioning Editor

    Pramila Balan

    Acquisition Editor

    Shaon Basu

    Content Development Editor

    Divij Kotian

    Technical Editor

    Naveenkumar Jain

    Copy Editor

    Rashmi Sawant

    Project Coordinator

    Neha Bhatnagar

    Proofreader

    Safis Editing

    Indexer

    Hemangini Bari

    Production Coordinator

    Komal Ramchandani

    Cover Work

    Komal Ramchandani

    About the Author

    Tanmay Deshpande is a Hadoop and big data evangelist. He currently works with Symantec Corporation as a senior software engineer in Pune, India. He has interests in a wide range of technologies, such as Hadoop, Hive, Pig, NoSQL databases, Mahout, Sqoop, Java, cloud computing, and so on. He has vast experience in application development in various domains, such as finance, telecom, manufacturing, security, and retail. He enjoys solving machine learning problems and likes to spend his time reading anything that he can get his hands on. He has a great interest in open source technologies and has been promoting them through his talks. He has been invited to various colleges to conduct brainstorming sessions with students on the latest technologies.

    Before Symantec Corporation, he worked with Infosys, where he worked as the lead Big Data/Cloud developer. He was a core team member of the Infosys Big Data Edge platform. Through his innovative thinking and dynamic leadership, he successfully completed various projects.

    Before he wrote this book, he also authored two books, Mastering DynamoDB and Cloud Computing. He regularly blogs at http://hadooptutorials.co.in

    Acknowledgments

    This is the third book in a row for me, and I can't stop myself from imagining this to be real without my grandparents' love and care. I know that they are there somewhere and constantly blessing me with their best wishes all the time. I would like to dedicate this book to my grandparents, Late Mrs. Usha and Late Mr. Bhaskar Deshpande, Mrs. Malati and Late Mr. Madhukar Budukh.

    I would like to thank my wife, Sneha, for standing beside me through thick and thin. She has been the source of inspiration and motivation to achieve bigger and better in life. I appreciate her patience to allow me to dedicate more time for this book and understanding what it means to me, without any complaints.

    I would like to thank my mom, Mrs. Manisha Deshpande, my dad, Mr. Avinash Deshpande, and my brother, Sakalya, for encouraging me to follow my ambitions and for making me what I am today.

    Above all, I would like thank the Almighty for giving me power to believe in my passion and pursue my dreams. This would not have been possible without the faith I have in him!

    About the Reviewers

    Sergio Alcantara has been building cloud-based platforms since the beginning of Amazon Web Services. Over the years, he has built the backend infrastructure for mobile and web applications that empowered GPS data, big data, and sports gaming. He has taken advantage of cloud computing to build highly reliable and scalable platforms.

    Among his latest projects, there are several that use DynamoDB in different ways, but two of them use DynamoDB as their main and only database.

    Enjoying the preview?
    Page 1 of 1