How to containerize a local DynamoDb

Click for: original source

This is going to be a very quick tutorial. I am going to show you how you can use Docker to spin up a DynamoDb. By Phillip Ninan.

This can very useful for prototyping an application where you need to persist some data. Since DynamoDb is a NoSQL database it gives developers a lot of flexibility. Also, if you do plan on using DynamoDb in production this is an easy way to get started without needing to pay.

The tutorial will walk you through:

  • Install locally
  • Create Dockerfile
  • Create docker-compose.yml
  • Start Your Database!
version: '3.7'

services:
  dev:
    container_name: dynamodb
    image: amazon/dynamodb-local
    ports:
      - "8000:8000"
    volumes:
      - dynamodata:/home/dynamodblocal
    command: "-jar DynamoDBLocal.jar -sharedDb -dbPath ."
volumes:
  dynamodata: {}

You can use this to persist data for your latest application or just spin it up to toy around with it. Working code available on author’s Github. Very handful!

[Read More]

Tags serverless nosql docker devops aws