Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
DynamoDB Cookbook
DynamoDB Cookbook

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

Arrow left icon
Profile Icon Deshpande
Arrow right icon
₱579.99 ₱2000.99
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.9 (8 Ratings)
eBook Sep 2015 266 pages 1st Edition
eBook
₱579.99 ₱2000.99
Paperback
₱2500.99
Subscription
Free Trial
Arrow left icon
Profile Icon Deshpande
Arrow right icon
₱579.99 ₱2000.99
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.9 (8 Ratings)
eBook Sep 2015 266 pages 1st Edition
eBook
₱579.99 ₱2000.99
Paperback
₱2500.99
Subscription
Free Trial
eBook
₱579.99 ₱2000.99
Paperback
₱2500.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

DynamoDB Cookbook

Chapter 1. Taking Your First Steps with DynamoDB

In this chapter, we will cover the following topics:

  • Signing up to the DynamoDB console
  • Creating the DynamoDB table using the console
  • Loading data into the table using the console
  • Querying data using the DynamoDB console
  • Deleting the DynamoDB table using the console
  • Analyzing DynamoDB metric on CloudWatch
  • Downloading and setting up DynamoDB Local
  • Using DynamoDB Local JavaScript Shell
  • Setting up AWS Command Line Interface for DynamoDB
  • Setting up the Eclipse IDE

Introduction

Amazon DynamoDB is a fully managed and cloud-hosted NoSQL database. NoSQL databases allow us to have a schema-less design for the tables. We only need to define the key, and the rest of the attributes can be defined at the time of record insertion itself.

DynamoDB provides a fast and predictable performance with the ability to scale seamlessly. It allows you to store and retrieve any amount of data, serving any level of network traffic without having any operational burden. DynamoDB gives numerous other advantages, such as a consistent and predictable performance, flexible data modelling, and durability. This chapter is all about taking your first steps with DynamoDB, getting your workspace ready, and seeing how to perform DynamoDB operations using the DynamoDB console. Now let's get started with the sign up process.

Signing up to the DynamoDB console

To get started with DynamoDB, we need to first create an account with Amazon Web Services.

Getting ready

AWS provides an interactive console to perform the Sign Up process. Being a pay-as-you-go model, we need to provide valid credit card details while registering. AWS also needs a valid phone, which is verified at the time of registration itself. So, you need to keep both the things handy.

How to do it…

Let's get started with DynamoDB:

  1. To sign in to the AWS Console, go to http://aws.amazon.com/.
  2. Click on the Sign in to the Console button:
    How to do it…
  3. To begin with the sign up process, follow the onscreen instructions by providing the valid e-mail address.
  4. Enter all the details asked correctly, and click on the Press Create Account button:
    How to do it…
  5. In the next screen, you would need to provide the contact information, and later, capture the billing information by providing the credit card information.
  6. The last step would be to provide your phone number. AWS calls the provided phone number, and you are supposed to enter the on screen PIN number on your phone dial pad. Once you are done, you will see the AWS Management console.
  7. Now, you can select the DynamoDB service under the Database section to go to the DynamoDB console:
    How to do it…
  8. That's it! You are all set to use DynamoDB.

How it works…

AWS manages the accounts created through its console, and allows the user to access it over defined authentication methods. For any new account, AWS provides the free tier up to a certain threshold. You can read more about this at http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-free-tier.html.

There's more…

Note that on registration, AWS charges you 1 USD for the verification of your credit card, but the payment gets reversed after some days. You may take a look at the AWS Billing FAQs for more details at http://aws.amazon.com/billing/faqs/.

Creating the DynamoDB table using the console

Now that we have signed up for AWS, let's start by creating our first DynamoDB table using the DynamoDB console.

Getting ready

To perform this recipe, you need to have completed the earlier recipe of Signing up to the DynamoDB AWS console.

How to do it…

Let's create our first DynamoDB table. The steps are as follows:

  1. Sign in to the AWS Console by providing valid account details, and go to the DynamoDB console, as shown in the previous recipe. You will see the following screen:
    How to do it…
  2. Click on the Create Table button. This will open a popup window where you will need to provide details, such as the Table Name, Primary Key, their data types, and so on. Here, we need to create a table called a product table, which will save the products-related data for all the e-commerce websites.

    Here, we will create a table with the Primary Key Type as the Hash and Range composite keys. We will have the hash key as the product id and range key as the product type. Add the details, as shown in the following screenshot, and click on Continue:

    How to do it…
  3. In the next screen, you need to add Global/Local Secondary Indexes. Here, we would like to query DynamoDB items with their name and manufacturer. So, we create an index, and click on the Add Index to Table button, as shown in the following screenshot. Once done, click on Continue to proceed with the next configuration:
    How to do it…

    Here, we are also selecting Projected Attributes as All Attributes, as we would like DynamoDB to give us all the attributes back when we query it. Alternatively, if you know exactly what attributes you need to be projected into this secondary index, you can select Specify Attributes, in the Projected Attributes dropdown, and add the specific attributes you want to be projected.

  4. Provide Read Capacity Units and Write Capacity Units, depending on the reads and writes load you are expecting. Here, I am providing the value 5 for Read Capacity Units and 5 for Write Capacity Units, as shown in the following screenshot. Click on the Continue button to proceed. A read capacity unit is a strong consistent read per second for items as large as 4 KB, while a write capacity unit is a strong consistent write per second for items as large as 1 KB:
    How to do it…
  5. The next screen will be all about setting up the throughput alarms. Here, you can select the checkbox for when you wish to get alarms in case your throughput reaches capacity. This is an optional configuration, so you may wish to skip it. Click on Continue to move to the next step.
  6. The last step is to review the summary. If you are okay with the configurations, then click on Create to actually create the DynamoDB table. If you think that there are some configurations that are missing, then you may wish to go back and change those.
  7. The newly created DynamoDB table may take some time to get active; in the meantime, you will see Status as Creating on the screen.
  8. Lastly, you will see that the table is created and is in the ACTIVE state:
    How to do it…

How it works…

In DynamoDB, we don't need to bother about the availability, scalability, and reliability of the table as it is completely owned by Amazon. We just need to create a table and start using it. We can modify the throughput units any time using the same console. This gives us the flexibility to control the reads and writes of the data from DynamoDB. For example, if you think that there is a certain period where you would be expecting more reads/writes, then you can increase the throughput values and vice versa. You can find out how AWS calculates the read and write throughput at

http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html.

Choosing a right key is very important in order to balance the load on DynamoDB partitions. The hash key should be chosen in such a way that it has unique values in it so that the data can be distributed across the cluster. The range key should be chosen in such a way that items can be grouped together so that if you have any such queries, they will perform faster. This is why we have chosen the product id as the Hash Key attribute, while the product type as the Range Key attribute.

The same is the case with Global Secondary Indexes. The Global secondary indexes allow us to query items on non-primary key attributes. Here, we may want to query items on their names or group them by the manufacturer.

DynamoDB supports various data types for its attributes, which are as follows:

  • Scalar: Number, String, Binary, Boolean, and Null
  • Multi-valued: String Set, Number Set, and Binary Set
  • Document: List and Map

You can choose which suites you best.

There's more…

Here, you might have noticed that instead of putting the manufacturer's name as a proper name to the range key in the Global Secondary Index, I chose to use its short form as mnfr. The reason for this is that when it comes to key-value pair types of databases, the entries stored in the database are always both keys and values together. So, every time you add an item or an attribute, it will be saved as key=value in the database. So, it's the best practice to use short yet meaningful names for keys and attributes. We will discuss such best practices in Chapter 7, DynamoDB Best Practices.

Loading data into the table using the console

We were able to create a table in DynamoDB in the previous recipe; now, we will load the data into that table using the console.

Getting ready

To perform this recipe, you need to have completed the earlier recipe of Creating the DynamoDB table using the console.

How to do it…

Let's load the data into the table:

  1. Select the table in which you wish to load the data into the console, and click on the Explore Table button.
  2. As we have not added any items to the table yet, it will show No Items Found on your screen, as shown in the following screenshot:
    How to do it…
  3. Click on the Create Item button to add a new item to the table. By default, it opens the Put Item screen in the Tree mode, where you can add values and the keys. You can also add more attributes to the item based on the requirements, as shown in the following screenshot:
    How to do it…
  4. Click on the Save button to add an item to the table.
  5. Repeat the earlier mentioned steps to add more items to the table.

How it works…

This simply adds the items against the DynamoDB table that we created. DynamoDB supports various data types, such as String, Number, Binary, String Set, Number Set, Map, List, Boolean, and Null. You can choose the correct data type that is suitable for the operations you would need to perform.

You can refer to the documentation for more details at http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html#DataModel.DataTypes.

Querying data using the DynamoDB console

In the earlier recipe, we learned how to add new items to the DynamoDB table. In this recipe, we will learn how to query the data that is added using the DynamoDB console.

Getting ready

To perform this recipe, you need to have completed the earlier recipe to add items to the DynamoDB table.

How to do it…

Let's perform different types of queries on AWS DynamoDB console:

  1. To perform the various types of queries, we will first need to go to the AWS DynamoDB console, select the table against which we would like to execute our queries, and then click on the Explore Table button. This will execute a scan operation on the selected table, which will look like this:
    How to do it…
  2. Now, to perform a query operation, select the Query radio button. In the dropdown below it, you will see a choice to perform the query either on the table indexes or secondary indexes, which were created earlier. The first query we will perform will be to get the item by its id. Here, if you want to fetch an item/s whose id is 1, put 1 in the textbox against the Hash Key, click on the Query button, and you will see the results immediately:
    How to do it…
  3. We can also query data by providing a combination of Hash Key and Range Key to narrow down our search. In the earlier scenario, we got two items: one with the type phone, and another with the type book. Now if we want to fetch the item whose id is 1 and the type is phone, then we can query that accordingly, and we will get the results as required:
    How to do it…
  4. We can also query data on the Global Secondary Index, which we created at the time of table creation:
    How to do it…
  5. Similarly, we can use the scan operations in order to fetch the data from the DynamoDB table. We can either do a complete scan or a filtered scan. To perform a complete table scan, we have to select the Scan radio button, and click on the Start New Scan button. As we have not put any filters on the scan, this operation will fetch all the items present in the given DynamoDB table:
    How to do it…
  6. We can also add filters to the scan operation by clicking on the Add Filter button, and then by providing the filtering criteria. For example, if we want to fetch all the items of the phone type, then we can specify the criteria, and execute the scan operation.
    How to do it…
  7. Scan filters allow comparison operations, such as equal to, less than, less than or equal to, greater than, greater than or equal to, null, not null, contains, not contain, begins with, and so on. You can use it as per your need. Scan filtering can also be performed on the global secondary index. For example, if we want to fetch all the items whose manufacture name starts with A, then we can add this filter and get the results:
    How to do it…

How it works…

Query and Scan are powerful operations that help us to retrieve data. However, both have their own working style and their own pros and cons.

A Query operation finds items in the table using the primary key attributes. You can specify the hash key and optional range key in order to get the desired items. By default, a Query operation returns all the attributes of a given item, but there is an option available to limit the attributes using ProjectionExpressions. While providing the key conditions, the Query operation expects an equality condition on the Hash Key attribute, but there are a set of conditions allowed to specify the Range Key conditions.

A query request can retrieve a maximum of 1 MB of data at a time. So, you need to plan the Query operation accordingly. You can optionally use FilterExpressions to narrow down this data. The Hash Key index is an unordered index, which means that we can only specify an exact key to fetch the items, whereas the Range Key index is an ordered index, which allows us to query that index using various ConditionalOperations, such as less than, greater than, begins with, between, and so on. If no matches are found, Query returns an empty result set.

A Scan operation examines each and every item in the given DynamoDB table, compares it with the condition, and gets the results back. By default, this also returns all the attributes of the items back to the user. Of course, we can use ProjectionExpressions to limit the set of attributes returned by the scan request.

A single scan request can fetch a maximum of 1 MB of data. To make the best use of it, we can also use FilterExpressions to narrow down the result set.

There are ways to handle this limitation of 1 MB of data per request, but we cannot do much using the DynamoDB console, so we will talk about all these details in Chapter 2, Operating with DynamoDB Tables.

Deleting the DynamoDB table using the console

In the earlier recipe, we discussed using the Query and Scan operations on the DynamoDB table using the console. Now, we will see how to delete a table using the same.

Getting ready

To perform this recipe, you need to create a table. Please create a dummy table, say dummyProduct, in DynamoDB using the recipe Creating the DynamoDB table using the console.

How to do it…

Note that by performing the following set of operations, the table and its data will get deleted forever, and there is no way to get it back, so I would suggest that you perform this recipe only if you know that the table is not needed anymore:

  1. Here, I have two tables in my DynamoDB console now, out of which I will delete a table called dummyProduct:
    How to do it…
  2. Select a table to be deleted, and click on the Delete Table button:
    How to do it…
  3. This will open up a pop-up window, which will ask you for your confirmation. Check the checkbox against the Delete this table text, and click on the Delete button:
    How to do it…
  4. This will start the deleting process, which will run for a while and erase the complete data.

How it works…

The delete operation completely erases the data in the given table and drops that table from DynamoDB. If you delete the DynamoDB table, there is no way to get that data back, so perform this operation very carefully. I would suggest that you avoid this operation if you don't know the criticality of this table.

Analyzing DynamoDB metric on CloudWatch

It is very important to keep an eye on DynamoDB CloudWatch metrics in order to see the DynamoDB performance. CloudWatch provides real-time monitoring and alerting mechanisms to services provided by DynamoDB.

Getting ready

To get a better understanding of DynamoDB metrics, considering the fact that we don't have much of our data in our product table, go to the Query and Scan operations console and perform various Query and Scan operations back to back in order to get some metrics. Simply clicking on the Query and Scan buttons with some sample conditions will do the job for you.

Of course, in real time, in production systems, you would not need to do this as we will automatically have sufficient reads, writes, queries, and scans in progress.

How to do it…

Let's understand DynamoDB metrics on Cloudwatch:

  1. Go to the DynamoDB console, and click on the table whose metrics you would like to analyze. You will notice that the bottom frame will start showing some details about the table. It will have various tabs, such as Details, which will have the table details, Indexes, which will have details about the secondary indexes that we created in our table, Monitoring, which will have the details about the CloudWatch metrics that we would like to see in detail, and the last tab, Alarm Setup, which is used to set up various alarms in case you wish to get any:
    How to do it…
  2. If you scroll down a bit, you will see various graphs, such as Read Capacity, Throttled Read Requests, Write Capacity, Throttled Write Requests, Read-Write Capacity for Global Secondary Indexes, that we created. It will also show you graphs related to Read/Write Latency and Query/Scan latency for a given time frame:
    How to do it…
  3. You can also click on individual graphs to see the enlarged view. I have made a significant number of scans in the last hour; if I want to see how DynamoDB performed for a particular time frame, I need to click on the Scan Latency graph, which will open the enlarged view of the graph, as shown in the following screenshot:
    How to do it…

    The preceding graph tells us the average time taken by DynamoDB in milliseconds to perform the various scan operations.

  4. You can also change the Statistic drop-down value to select the various metrics. For example, if I want to see the exact time taken by each scan request over the last hour, it will show you the results immediately. I can also click on the data points on the graph to see the exact time. Here is an example of it:
    How to do it…

    Here, the graph tells us that the very first scan request took approximately 140 milliseconds to fetch the results, whereas the latency dropped in subsequent requests, and eventually, improved the performance.

How it works…

Almost every operation in Cloud is measured in terms of bytes read/written. CloudWatch keeps track of the requests that we make to DynamoDB and stores it in the internal data store. While generating the graphs, we will use these data points, which will help us analyze the performance.

There's more…

You can also analyze other CloudWatch metrics to better understand the DynamoDB behavior. These graphs will also help you decide upon the throughput values set for the tables and secondary indexes. If you see the consumed read/write capacity reaching the provisioned read/write capacity, then you can increase the provisioned throughput and vice versa.

Always look for consistent metrics; you might miss out on certain spikes because a lot of graphs give you an average of values over the last 5 minutes of time. For more detailed metrics, you can go to the CloudWatch console and look out for DynamoDB metrics at https://console.aws.amazon.com/cloudwatch/https://console.aws.amazon.com/cloudwatch/.

Downloading and setting up DynamoDB Local

A call to any cloud resource may cost money to you, even if you are just doing development and not talking about any hosting in the production cluster. During development, we may need to try many things, and all those trials would cost us. The development best practices demand us to follow a test-driven development. For continuous integration and builds, it's good to run unit tests and integration tests to make sure that the build is intact. If we keep running unit tests and integration tests on the actual DynamoDB, we may end up paying a lot. To cater to this issue, we have something called as DynamoDB Local.

DynamoDB Local is a small client-side database and server that mimics the actual DynamoDB. It enables you to develop and test your code in the local environment, without modifying anything on the actual DynamoDB. It is compatible with the actual DynamoDB API, so there is no need to worry about duplicating your efforts.

Getting ready

DynamoDB Local is a Java Archive (JAR) file, which will run on the Windows, Mac, or Linux machines. To execute these APIs, you should have Java Runtime Engine (JRE) 6.0+ installed on your machine. You can refer to following docs to install JRE on your machine:

For Windows 64-bit machine: http://www.oracle.com/technetwork/java/javase/install-windows-64-142952.html.

For Windows 32-bit machine: http://www.oracle.com/technetwork/java/javase/install-windows-141940.html.

For Mac: http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jre.html.

How to do it…

You can download DynamoDB Local from the following locations:

Now, let's perform the following steps to install DynamoDB Local:

  1. Once done, just unzip the .jar file, and save it in a folder.
  2. Now use Command Prompt, go to the folder where you have unzipped the .jar file, and execute the following command:
    java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar
    

    You will see the jetty server getting started at http://localhost:8000:

    How to do it…
  3. Now you can use this as an endpoint for your development. For example, if we want to use it in the Java SDK, we can use this as follows:
    client = new AmazonDynamoDBClient(credentials);
    client.setEndpoint("http://localhost:8000");

    We will see more of its uses in the following chapters.

How it works…

DynamoDB Local is a simple .jar file that runs on your local machine and mimics the actual DynamoDB. You can do your development using DynamoDB, test your code, and simply redirect to the actual DynamoDB whenever it is ready for production deployment. Even though DynamoDB Local mimics most of the DynamoDB features, it does not support some important ones, which are as follows:

  • It does not consider the provisioned throughput settings while making any calls.
  • It does not throttle the read or write activity. The CreateTable, UpdateTable, and DeleteTable operations occur immediately. The table state is always ACTIVE.
  • It does not keep track of the consumed capacity units. So, it always returns null instead of the actual capacity units.
  • Read operations in DynamoDB are eventually consistent, but due to the speed of DynamoDB Local, it appears to be strongly consistent.

There's more…

The DynamoDB Local .jar gives you various other options in addition in order to manage DynamoDB Local smoothly. Here are some more options:

The -help function will list all the options available with DynamoDB Local JAR, as shown in the following command:

java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar – help

The output is shown in the following command:

There's more…

Using DynamoDB Local JavaScript Shell

With the latest version of DynamoDB Local, you can also get an interactive DynamoDB Local JavaScript shell. In this recipe, we are going to see how to use it.

Getting ready

To perform this recipe, you need to have completed the earlier recipe of Downloading and setting up DynamoDB Local.

How to do it…

Enabling DynamoDB Local does not require any extra effort; we need to simply start DynamoDB Local, and go to http://localhost:8000/shell/ in the browser of your choice - you will see the interactive shell:

How to do it…

This interesting hands-on tutorial will help you understand DynamoDB. At the end of this tutorial, you will be able to create certain tables, try out various item levels and operations, and also create a demo application. Just use the navigation options as directed and this will be done.

How it works…

This DynamoDB Local Shell application runs using a regular application server and code in Java/JavaScript. This gets more interesting as you will actually get to do many things using DynamoDB JavaScript commands.

Setting up AWS Command Line Interface for DynamoDB

The AWS Command Line Interface allows us to operate various AWS resources from the command line itself. In this recipe, we are going to see how to use these and perform operations.

Getting ready

You can download the installer for Windows, Mac, or Linux from http://aws.amazon.com/cli/.

How to do it…

The AWS CLI for DynamoDB supports various commands, such as batch-get-item, batch-write-item, create-table, delete-item, delete-table, describe-table, get-item, list-tables, put-item, query, scan, update-item, update-table, wait, and so on.

To get started, we need to first configure the AWS CLI:

  1. Start Command Prompt, and type the following command:
    aws configure
    
  2. This will ask you for the Access Key, Secret Key, and Region details. If you have not downloaded the AWS keys yet, you can download them from https://console.aws.amazon.com/iam/home?#security_credential.
  3. Here, you can download the Access Keys and save it in a secure place. Once the keys are submitted, you can start accessing DynamoDB from the command line.
  4. We need to list the tables that we have already created, and then we can execute this command:
    aws dynamodb list-tables
    

    The output of the following command is shown below:

    How to do it…
  5. We can also run the Query operations from the command line as well. Suppose that we want to Query a product table for id =5, then we have to write this condition in the JSON document and save it on our machine. The JSON file would like this:
    {"id": {"AttributeValueList": [{"S":"5"}],"ComparisonOperator": "EQ" }}

    Assume that we saved it in a file named conditions.json; then, to execute the query, we have to run the following command:

    aws dynamodb query --table-name product --key-conditions file://conditions.json
    

    The output would be something like this:

    How to do it…

    We can also specify conditions for the Range Key in order to narrow down our results, which is similar to what we did for the Hash Key.

How it works…

The AWS CLI, which is internally called DynamoDB APIs, is used to retrieve results. For authentication, it uses the Access Key and Secret Key that you provide at the time of configuration.

There's more…

You can also try out various other options from the AWS CLI for DynamoDB, which are available at http://docs.aws.amazon.com/cli/latest/reference/dynamodb/index.html#cli-aws-dynamodb.

Setting up the Eclipse IDE

Eclipse is an IDE, which is used mostly for Java development. In order to avoid switching screens between Eclipse and your browser, you can simply install the AWS plugin for Eclipse. In this recipe, we are going to see how to set up this plugin, and how to use it to perform various DynamoDB operations.

Getting ready

The first thing you need to do is install Eclipse on your laptop/desktop. The latest version from Eclipse can be downloaded from https://eclipse.org/downloads/. You need to select the Eclipse IDE for Java developers. Simply extract the ZIP file, and you are ready to go.

How to do it…

To install the AWS Explore plugin in Eclipse, we need to perform the following steps:

  1. Open Eclipse, and go to Help | Install New Software.
  2. In the Work with box, type http://aws.amazon.com/eclipse, and press Enter.
  3. Select AWS Toolkit for Eclipse, and install the plugin:
    How to do it…
  4. Once done, it will prompt you to restart Eclipse. On restart, it will give you a popup to enter your AWS Access Key and Secret Key. We have already seen how to get the AWS Access Key and Secret Key for your account. Enter this information, and you are ready to use the AWS Explorer.
  5. Now, you can open the AWS Explorer. By selecting Amazon DynamoDB, you will be able to see the table that we created earlier:
    How to do it…
  6. Now, we can perform the Scan operation by specifying the conditions. For example, to get all the items of the type book, we can do something like this:
    How to do it…

    Now you can perform the various queries using this AWS Explorer.

How it works…

The AWS Explorer for Eclipse uses the Java SDK internally to make calls to DynamoDB and shows the results to us. It authenticates each call using the Access Key and Secret Key that we provided at the time of configuration.

Left arrow icon Right arrow icon

Description

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.

Who is this book 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 backoffs and autoretries, 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

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 25, 2015
Length: 266 pages
Edition : 1st
Language : English
ISBN-13 : 9781784391096
Category :
Concepts :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Sep 25, 2015
Length: 266 pages
Edition : 1st
Language : English
ISBN-13 : 9781784391096
Category :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just ₱260 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just ₱260 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 7,451.97
Mastering DynamoDB
₱2449.99
DynamoDB Applied Design Patterns
₱2500.99
DynamoDB Cookbook
₱2500.99
Total 7,451.97 Stars icon
Banner background image

Table of Contents

11 Chapters
1. Taking Your First Steps with DynamoDB Chevron down icon Chevron up icon
2. Operating with DynamoDB Tables Chevron down icon Chevron up icon
3. Manipulating DynamoDB Items Chevron down icon Chevron up icon
4. Managing DynamoDB Indexes Chevron down icon Chevron up icon
5. Exploring Higher Level Programming Interfaces for DynamoDB Chevron down icon Chevron up icon
6. Securing DynamoDB Chevron down icon Chevron up icon
7. DynamoDB Best Practices Chevron down icon Chevron up icon
8. Integrating DynamoDB with other AWS Services Chevron down icon Chevron up icon
9. Developing Web Applications using DynamoDB Chevron down icon Chevron up icon
10. Developing Mobile Applications using DynamoDB Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.9
(8 Ratings)
5 star 50%
4 star 25%
3 star 0%
2 star 12.5%
1 star 12.5%
Filter icon Filter
Top Reviews

Filter reviews by




Kenny Ha Nov 28, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I really wished that this book had came out a few years earlier. This excellent NoSQL DynamoDB Cookbook will allow you to gain insights into the next generation of high-availability, reliability and infinite scalability of developing internet & mobile applications. Whether you're a programmer or an architect, if you're looking to design scalable distributed systems, you must check out this book. This book provides a step-by-step instruction on how to create tables and manipulate items. There are examples of best practices and sample codes to help you manage primary key type, hash and range attributes along with global local and secondary indices. In addition, there are integration examples with other advanced AWS services. You can get this book at https://www.packtpub.com/big-data-and-business-intelligence/dynamodb-cookbook. For further technical reading, you can visit http://oneglobalonline.com.
Amazon Verified review Amazon
SuJo Dec 02, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I have a MySQL / MSSQL / MongoDB background for all of my web applications and I wanted to branch out into DynamoDB for performance gains in highly available applications. The book covered everything clearly, how to achieve high read/write throughput while guiding you with best practices. While I just started with the NoSQL databases this one worked fine for my tests, and in a data-driven environment it will certainly out perform my slow MSSQL transactions. Not to mention the per core licence M$ is doing, crazy! I highly recommend this book if you want to get serious about high availability for data demanding applications.
Amazon Verified review Amazon
PJG Dec 01, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
As with many cookbooks of this type, the entire thing rests on whether the recipes included are actually of practical use or not. In this case, they most definitely are, and follow a well-arranged and logical order that starts from the basics. The great thing about the recipes is that they reallydo allow the reader to get to grips with a well-featured and highly-performant NoSQL database, and the book really hits the ground running. The chapters include relevant 'best practices' and a very useful later chapter on how to integrate DynamoSB with other AWS services.As with many Packt titles, the book is succinct - just under 200 pages - but this style seems to work much better in cookbook format where very specific examples, that are relatively self-contained, are presented. Recommended for anyone looking to get acquainted with DynamoDB through practical examples.
Amazon Verified review Amazon
ruben Dec 02, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
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 is a very complete title, I have used MySQL it is an important book that it helps me to learn other tool to manage Database, it is a useful material
Amazon Verified review Amazon
Neeraj Goel Oct 15, 2018
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
As expected
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.