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

Preface

AWS DynamoDB is an excellent example of a production-ready NoSQL database. It is hosted on Amazon public cloud, so within a few clicks, you can create your table and get started with it. Within 2 years of its release, DynamoDB has been able to attract many customers because of its features, such as high availability, reliability, and Internet scalability. With the popularity of mobile applications, everyone is dreaming of publishing his/her own mobile app, so for all such developers, DynamoDB is a great option because of its cost effectiveness and usability.

This book is a practical, example-oriented guide that starts with an introduction to DynamoDB, how it started, what it is, and its features. It then introduces you to DynamoDB's data model, demonstrating CRUD operations on the data model. Once you get a hold over the data model, it enables you to dive deep into the DynamoDB architecture to understand its flexibility, scalability, and reliability. This book also enlightens you on how to use DynamoDB as a backend database for mobile applications. It also has detailed explanations on DynamoDB's security in order to make your applications secure. It is concise, with clean topic descriptions, plenty of screenshots, and code samples to enhance clarity and to help you try and test things on your own.

What this book covers

Chapter 1, Getting Started, highlights why we need the cloud-hosted NoSQL database, introduces readers to various NoSQL databases, and then starts with what DynamoDB is all about, what its history is, and its features.

Chapter 2, Data Models, introduces readers to DynamoDB's rich data model, its data types, and various operations one can perform using AWS SDK for DynamoDB with various languages, such as Java, .NET, and PHP. This also provides good detail on modeling relationships in DynamoDB.

Chapter 3, How DynamoDB Works, gives an insight into the DynamoDB architecture and the various techniques it uses to maintain its highly distributed structure, the ring topology, replication synchronization, fault tolerance, and so on.

Chapter 4, Best Practices, details readers on how they can save their money by making time- and cost-efficient calls to DynamoDB. It also enables readers to deal with DynamoDB limitations. It talks about table best practices, item and indexes best practices, use of caching techniques, time series best practices, and so on.

Chapter 5, Advanced Topics, covers detailed understanding of CloudWatch monitoring, use of Identity and Access Management for DynamoDB operations, creating and applying security policies, and the use of the AWS Secure Token Service to generate temporary credentials. It also details error handling in DynamoDB and how to set auto retries and exponential back-offs on failures.

Chapter 6, Integrating DynamoDB with Other AWS Components, enlightens readers about the AWS ecosystem, how they can integrate other AWS components, such as Elastic Map Reduce (EMR), S3, RedShift, CloudSearch, and so on, in order to have everything that they want to do with their application in one place.

Chapter 7, DynamoDB – Use Cases, provides readers with examples on creating an end-to-end use case, what technology stack they use, how they leverage DynamoDB SDK APIs, and so on.

Chapter 8, Useful Libraries and Tools, introduces users to some very cool, ready-to-use libraries, such as Geo Library, Transaction Library, and libraries in various languages, such as Perl, Python, Ruby, Go, Erlang, and so on. It also gives insights into useful tools that enable users to test their code offline, tools that enable auto-scaling of production applications, and tools that provide utilities, such as backup/archiving of DynamoDB data.

Chapter 9, Mobile Apps Development using DynamoDB, gives users directions on how to use DynamoDB SDKs for iOS and Android and helps them to build Internet-scalable mobile applications easily. It also provides various options on building a secure user-management technique.

What you need for this book

This book requires you to have a basic understanding of Cloud, Amazon Web Services, and NoSQL databases. It has code snippets provided in various popular languages, such as Java, .NET, and PHP. So, basic understanding of one of these languages is good to have. The content is explained in simple English and has been explained using diagrams, screenshots, and suitable examples.

Who this book is for

This book is for web/mobile application developers, managers who are considering undertaking a project on DynamoDB, the NoSQL users who are sick of maintaining the distributed clusters, and security analysts who want to validate the security measures imposed by Amazon.

Conventions

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: "This configuration option allows us to set the maximum number of times HttpClient should retry sending the request to DynamoDB."

A block of code is set as follows:

   // Create a configuration objectfinal ClientConfiguration cfg = new ClientConfiguration();// Set the maximum auto-reties to 3cfg.setMaxErrorRetry(3);
    // Set configuration object in Clientclient.setConfiguration(cfg);

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

AmazonDynamoDBClient client = new AmazonDynamoDBClient();

// Set geo table in configuration
GeoDataManagerConfiguration geoDataManagerConfiguration = new GeoDataManagerConfiguration(
        client, "geo-table");
    
// Create Geo data manager
GeoDataManager geoDataManager = new GeoDataManager(geoDataManagerConfiguration);

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

mvn clean install -Dgpg.skip=true

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: "You can click on Continue to move ahead."

Note

Warnings or important notes appear in a box like this.

Tip

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 www.packtpub.com/authors.

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.

Downloading the example code

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.

Errata

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 http://www.packtpub.com/submit-errata, 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 http://www.packtpub.com/support.

Piracy

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.

Questions

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.