DynamoDB Cookbook
()
About this ebook
Read more from Deshpande Tanmay
Mastering DynamoDB Rating: 0 out of 5 stars0 ratingsHadoop Blueprints Rating: 0 out of 5 stars0 ratingsHadoop Real-World Solutions Cookbook - Second Edition Rating: 0 out of 5 stars0 ratingsHadoop: Data Processing and Modelling Rating: 0 out of 5 stars0 ratings
Related to DynamoDB Cookbook
Related ebooks
Amazon EC2 Cookbook Rating: 0 out of 5 stars0 ratingsMongoDB Cookbook - Second Edition Rating: 0 out of 5 stars0 ratingsLearning DevOps: Continuously Deliver Better Software Rating: 5 out of 5 stars5/5Amazon S3 Cookbook Rating: 0 out of 5 stars0 ratingsJavaScript JSON Cookbook Rating: 0 out of 5 stars0 ratingsApache Maven Cookbook Rating: 0 out of 5 stars0 ratingsDynamoDB Applied Design Patterns Rating: 3 out of 5 stars3/5Serverless Architectures on AWS: With examples using AWS Lambda Rating: 0 out of 5 stars0 ratingsAWS Lambda in Action: Event-driven serverless applications Rating: 0 out of 5 stars0 ratingsAI as a Service: Serverless machine learning with AWS Rating: 1 out of 5 stars1/5AWS DynamoDB A Complete Guide Rating: 0 out of 5 stars0 ratingsGetting MEAN with Mongo, Express, Angular, and Node Rating: 5 out of 5 stars5/5Kubernetes Native Microservices with Quarkus and MicroProfile Rating: 0 out of 5 stars0 ratingsKafka in Action Rating: 0 out of 5 stars0 ratingsIrresistible APIs: Designing web APIs that developers will love Rating: 0 out of 5 stars0 ratingsAmazon Web Services in Action Rating: 0 out of 5 stars0 ratingsGraphQL in Action Rating: 2 out of 5 stars2/5Event Processing in Action Rating: 0 out of 5 stars0 ratingsRedux in Action Rating: 0 out of 5 stars0 ratingsJava Persistence with Spring Data and Hibernate Rating: 0 out of 5 stars0 ratingsDocker in Action, Second Edition Rating: 3 out of 5 stars3/5Microservices Security in Action Rating: 0 out of 5 stars0 ratingsCloud Native Patterns: Designing change-tolerant software Rating: 4 out of 5 stars4/5Elasticsearch in Action Rating: 0 out of 5 stars0 ratingsMicroservices Deployment Cookbook Rating: 0 out of 5 stars0 ratingsThe Tao of Microservices Rating: 0 out of 5 stars0 ratingsGradle in Action Rating: 4 out of 5 stars4/5Serverless Architectures on AWS, Second Edition Rating: 5 out of 5 stars5/5Microservices in Action Rating: 0 out of 5 stars0 ratings
Internet & Web For You
Coding For Dummies Rating: 5 out of 5 stars5/5The $1,000,000 Web Designer Guide: A Practical Guide for Wealth and Freedom as an Online Freelancer Rating: 5 out of 5 stars5/5More Porn - Faster!: 50 Tips & Tools for Faster and More Efficient Porn Browsing Rating: 3 out of 5 stars3/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5Hacking : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Ethical Hacking Rating: 5 out of 5 stars5/5Learn JavaScript in 24 Hours Rating: 3 out of 5 stars3/5The Mega Box: The Ultimate Guide to the Best Free Resources on the Internet Rating: 4 out of 5 stars4/5Cybersecurity For Dummies Rating: 4 out of 5 stars4/5Beginner's Guide To Starting An Etsy Print-On-Demand Shop Rating: 0 out of 5 stars0 ratingsHow to Disappear and Live Off the Grid: A CIA Insider's Guide Rating: 0 out of 5 stars0 ratingsSocial Engineering: The Science of Human Hacking Rating: 3 out of 5 stars3/5The Logo Brainstorm Book: A Comprehensive Guide for Exploring Design Directions Rating: 4 out of 5 stars4/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5Remote/WebCam Notarization : Basic Understanding Rating: 3 out of 5 stars3/5The Beginner's Affiliate Marketing Blueprint Rating: 4 out of 5 stars4/5The Digital Marketing Handbook: A Step-By-Step Guide to Creating Websites That Sell Rating: 5 out of 5 stars5/5The Designer's Web Handbook: What You Need to Know to Create for the Web Rating: 0 out of 5 stars0 ratingsThe Internet Is Not What You Think It Is: A History, a Philosophy, a Warning Rating: 4 out of 5 stars4/5How To Start A Profitable Authority Blog In Under One Hour Rating: 5 out of 5 stars5/5Six Figure Blogging Blueprint Rating: 5 out of 5 stars5/5200+ Ways to Protect Your Privacy: Simple Ways to Prevent Hacks and Protect Your Privacy--On and Offline Rating: 0 out of 5 stars0 ratingsHow To Make Money Blogging: How I Replaced My Day-Job With My Blog and How You Can Start A Blog Today Rating: 4 out of 5 stars4/5Wireless Hacking 101 Rating: 4 out of 5 stars4/5How To Start A Podcast Rating: 4 out of 5 stars4/5Podcasting For Dummies Rating: 4 out of 5 stars4/5
Reviews for DynamoDB Cookbook
0 ratings0 reviews
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.