Would you like to be able to write and test code that uses the Amazon DynamoDB API even if you have no network connection and without incurring any usage charges (AWS Free Usage Tier notwithstanding)?
If so, you are going to love our new DynamoDB Local test tool. DynamoDB Local is a client-side database that supports the complete DynamoDB API, but doesn't manipulate any tables or data in DynamoDB itself. You can write code while sitting in a tree, on the beach, or in the desert.
When you are ready to deploy your application, you simply instruct it to connect to the actual DynamoDB endpoint. No other modifications will be needed.
Installing and Running DynamoDB Local
DynamoDB Local is available as an executable Java archive (JAR) file. It will run on Windows, Mac, and Linux systems and is compatible with version 7 of the Java Runtime Environment (JRE). It will not work on older versions of Java.
Download the DynamoDB Local JAR, put it in the directory of your choice, and open a command prompt in that directory. Launch DynamoDB Local like this:
DynamoDB Local will create a local database in the same directory as the JAR. The file name will have the form MyAccessKeyId_Region.db, where MyAccessKeyId is the AWS access key used to access DynamoDB Local and Region is the target region.
Configure your application so that it uses the local endpoint. DynamoDB Local listens on port 8000 by default; you can change this by specifying the --port option when you start it. If you are using the default port, the local endpoint will be localhost:8000.
Here are a couple of things to keep in mind as you start to use DynamoDB Local:
- DynamoDB Local ignores your provisioned throughput settings. The values that you specify when you call CreateTable and UpdateTable have no effect. In addition, DynamoDB Local does not throttle read or write activity.
- The values that you supply for the AWS access key and the Region are only used to name the database file.
- Your AWS secret key is ignored but must be specified.
- DynamoDB Local does not have a durability or availability SLA. it is not recommended for production use.
Download DynamoDB Local here, give it a shot, and let me know what you think! Documentation can be found here. You may also find our new Amazon DynamoDB Best Practices, How Tos, and Tools page to be useful.
For Questions & Support
This post has been very popular and a number of questions have been asked and answered in the comments. For best results, please head over to the DynamoDB Forum.
PS - I almost forgot -- check out the DynamoDB mock layers written by AWS customers here. I have updated this post several times since I first published it last year.