Amazon DynamoDB
Getting Started Guide (API Version 2012-08-10)

Tutorial: Basic DynamoDB Operations

In this tutorial, you learn the basics of DynamoDB operations. You do this using the downloadable version of DynamoDB, running on your computer.

This edition of DynamoDB includes an interactive JavaScript shell, where you can get hands-on experience with the DynamoDB API:

DynamoDB JavaScript Shell

To use the shell, you enter JavaScript code on the left side, and then click the play button arrow () to run the code. The right side shows you the results.

In this tutorial you create a table called Music and perform various operations on it, including add items, modify items, and read items. This exercise provides JavaScript code snippets that you copy and paste into the shell.

When you complete this tutorial, you will have gained hands-on experience with most of the DynamoDB API operations.

Cost: Free.


Before you begin this tutorial, you need to download and run DynamoDB so that you can access the built-in JavaScript shell.

Download and Run DynamoDB

DynamoDB is available as an executable .jar file. It runs on Windows, Linux, Mac OS X, and other platforms that support Java. Follow these steps to download and run DynamoDB on your computer.

  1. Download DynamoDB for free using one of these links:


    The downloadable version of DynamoDB may be available in repositories such as Homebrew, yum and APT, but it is not guaranteed to be the latest version. To make sure you have the latest version, use one of the links shown above.

    DynamoDB supports the Java Runtime Engine (JRE) version 6.x or newer; it does not run on older JRE versions.

  2. After you have downloaded the archive to your computer, extract the contents and copy the extracted directory to a location of your choice.

  3. To start DynamoDB, open a command prompt window, navigate to the directory where you extracted DynamoDBLocal.jar, and enter the following command:

    java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb


    DynamoDB uses port 8000 by default. If port 8000 is unavailable, this command throws an exception. You can use the -port option to specify a different port number. For a complete list of DynamoDB runtime options, including -port , type this command:

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

    If you need to stop DynamoDB, you can do so by pressing Ctrl-C.

  4. You can now access the built-in JavaScript shell.


    We recommend that you run the DynamoDB JavaScript shell on Firefox or Chrome. If you run the JavaScript shell in other browsers, errors may occur.

    Open a web browser on your computer and go to the following URL: http://localhost:8000/shell