Running AWS DynamoDB in your local workspace

Running AWS DynamoDB in your local workspace

Recently, I was working on a hobby project with Dynamo DB. While in development, I was doing a lot of calls to the actual AWS Dynamo DB. I wanted to avoid this and after some research, I was able to run it in local. I will share the same here so that you can also take benefit of it!


AWS is the future of Cloud computing. Check this previous article where I talk about some of the services.

AWS Cloud Computing
AWS and its use.

What is Dynamo DB?
Dynamo DB

Amazon DynamoDB is a completely managed NoSQL database service with seamless scalability and fast and consistent performance. DynamoDB lets you offload the administrative burdens of operating and scaling a distributed database so that you don't have to worry about hardware provisioning, setup, and configuration, replication, software patching, or cluster scaling. DynamoDB also offers encryption at rest, which eliminates the operational burden and complexity involved in protecting sensitive data.

High Availability and Durability

  • DynamoDB distributes your tables' data and traffic through a sufficient number of servers to meet your throughput and storage needs while ensuring consistent and fast performance.
  • All of your data is stored on solid-state discs (SSDs) and is automatically distributed across several AWS Region Availability Zones, ensuring high availability and data durability.

While you are doing some development locally, you might not always want to connect to your AWS resources for many reasons.

Some of them are:

  • Security 🔐
  • Save on throughput, data storage, and data transfer fees 💲
  • No need for an internet connection while developing an application 💻

There are multiple ways of running DynamoDB locally but I will show the one I prefer.

THE DOCKER WAY!

Steps to run Dynamo DB in local.

  • Get Docker Installed on your machine

Windows: https://docs.docker.com/docker-for-windows/install/
Mac: https://docs.docker.com/docker-for-mac/install/

  • Pull the Dynamo DB Local Images
docker pull amazon/dynamodb-local
  • Run the docker container from the image
docker run --name mydynamodb -p 3039:8000 amazon/dynamodb-local

This will execute dockerized AWS Dynamo DB on local at port 3039.

Finally, you have the Dynamo DB running and open to all sorts of applications ✔


Now use this to connect with your Go, Java, .NET, or Mule Code.

Hope you like it.