Running DynamoDB on Your Computer
In addition to the Amazon DynamoDB web service, AWS provides a downloadable version of DynamoDB that you can run locally. This edition of DynamoDB lets you write applications without accessing the actual Amazon DynamoDB web service. Instead, the database is self-contained on your computer.
This local version of DynamoDB can help you save on provisioned throughput, data storage, and data transfer fees. In addition, you do not need to have an Internet connection while you are developing your application. When you are ready to deploy your application in production, you can make some minor changes to your code so that it uses the Amazon DynamoDB web service.
Downloading and Running DynamoDB
The downloadable version of DynamoDB is provided as an executable
file. It will run on Windows, Linux, Mac OS X, and other platforms that support Java.
Follow these steps to download and run DynamoDB on your computer:
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 on your computer requires the Java Runtime Engine (JRE) version 6.x or newer; it will not run on older JRE versions.
After you have downloaded the archive, extract the contents and copy the extracted directory to a location of your choice.
To start DynamoDB on your computer, 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
You will see occasional diagnostic messages in the window where DynamoDB is running.
DynamoDB will process incoming requests until you stop it. To stop DynamoDB, type Ctrl+C in the command prompt window.
Command Line Options
DynamoDB running on your computer accepts the following command line options:
-corsis an asterisk (*), which allows public access.
value— The directory where DynamoDB will write its database file. If you do not specify this option, the file will be written to the current directory. Note that you cannot specify both
-delayTransientStatuses— Causes DynamoDB to introduce delays for certain operations. DynamoDB can perform some tasks almost instantaneously, such as create/update/delete operations on tables and indexes; however, the actual DynamoDB service requires more time for these tasks. Setting this parameter helps DynamoDB simulate the behavior of the Amazon DynamoDB web service more closely. (Currently, this parameter introduces delays only for global secondary indexes that are in either CREATING or DELETING status.)
-help— Prints a usage summary and options.
-inMemory— DynamoDB; will run in memory, instead of using a database file. When you stop DynamoDB;, none of the data will be saved. Note that you cannot specify both
-optimizeDbBeforeStartup— Optimizes the underlying database tables before starting up DynamoDB on your computer. You must also specify
-dbPathwhen you use this parameter.
value— The port number that DynamoDB will use to communicate with your application. If you do not specify this option, the default port is
DynamoDB uses port 8000 by default. If port 8000 is unavailable, this command will throw an exception. You can use the
-portoption 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
-sharedDb— DynamoDB will use a single database file, instead of using separate files for each credential and region. If you specify
-sharedDb, all DynamoDB clients will interact with the same set of tables regardless of their region and credential configuration.