DEV Community

Rafael Rotiroti
Rafael Rotiroti

Posted on

How run & use DynamoDB locally

This post intent to be simple and direct.

We are going to run DynamoDB locally and connect with him using NoSQL Workbench.

Before we start, check if you have Docker running on your machine. Else not, install here

Choose an folder or create a new one, inside this folder create a file docker-compose.yml:

version: '3.8'
services:
  dynamodb-local:
    command: "-jar DynamoDBLocal.jar -sharedDb -dbPath ./data"
    image: "amazon/dynamodb-local:latest"
    container_name: dynamodb-local
    ports:
      - "8000:8000"
    volumes:
      - "./docker/dynamodb:/home/dynamodblocal/data"
    working_dir: /home/dynamodblocal
Enter fullscreen mode Exit fullscreen mode

In your terminal, inside the folder you created the file run following command:
docker-compose up

If everything is well, this should be the result of your terminal:
Command Finished

Lets connect with DynamoDB using NoSQL Workbench.

Download and install using AWS NoSQL Workbench

Open the NoSQL Workbench Software.

Choose Amazon DynamoDB:
Amazon DynamoDB

Click in Operation Builder and Add Connection:

Add Connection

Setup your connection:

Fill all fields

And everything should be okay if you see this screen:

Connection Estabilished

Hope this article helped you.

Top comments (1)

Collapse
 
leewynne profile image
Lee

Didn't even know you could do this.. Is this like ECS anywhere (but for key/value).