<img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=299788&amp;fmt=gif">

How to Develop DynamoDB Local

Software Development, Software Solutions, AWS

By Justin Freeman

Develop DynamoDB Locally

DynamoDB is Amazon’s version of a NoSQL database. Now normally like everyone in the Amazon web space, you have to develop your application remotely. And every developer knows that developing remotely is a huge pain.

Not only do you have to worry about network and speed issues, you also have to worry about racking up unnecessary costs developing DynamoDB. Amazon charges depending on how much space, network bandwidth etc, you use. Your application isn’t even in production!

Up until recently, using DynamoDB was no exception. But now you have DynamoDB Local!

DynamoDB Local is a fully functional, self-contained version of Amazon’s DynamoDB NoSQL database. It runs entirely on your local machine and does not require any of kind of internet connection to Amazon.

The best part is, you don’t get charged for transactions you run using the local version of DynamoDB. This keeps development costs way down. You can develop your application, run speed and load tests all the time without having to worry about being charged for the bandwidth. It really is the best of both worlds. You get to use a high-quality NoSQL database that will be situated in the cloud AND you can do full testing on your application BEFORE you release to AWS.

Getting Started with DynamoDB Local

It's fairly simple. Go to Amazon’s website and download the DynamoDB Local executable and install it along with the latest version of the JDK. Next, run the command below to bring up the database.

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


This will start open DynamoDB on your machine at port 8888. Now to access the DynamoDB console, just go to http://localhost:8888/shell

The only difference here is the DynamoDB Local interface is a JavaScript shell. There are not any easy buttons to list tables or create tables like DynamoDB on AWS. Still, the interface is pretty intuitive. A screenshot:

You can look up commands with the JavaScript shell using the the second button on the right, and it will take expand the commands you can run such as Creating, Updating and List Tables and Creating, Updating and Removing items in these tables.

Simply copy the command and paste it into the window above. That's it! You are not manipulating data and tables in your own DynamoDB database, and it isn’t costing you a thing!

Now that you have a local DynamoDB running on your local development environment, you can use Amazon’s Java API for DynamoDB to write your application to work with DynamoDB. To make it even easier, there is also a Spring community version for DynamoDB which allows you some JPA support.

Now I will warn you that support for JPA is not very robust. I ran into several issues using it. There were a few things that were just not supported. Keep in mind this a community version, therefore support for things is much slower. I ended up with the normal Java API developed by Amazon to use some of the more advanced features I needed in order to complete my application.

Welcome to the wonderful world of local development using DynamoDB. Enjoy!

Managing JIRA at Scale White Paper

TAGS: Software Development, Software Solutions, AWS

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Subscribe to Our Newsletter

Recent Blog Posts