/dev/random

Running DynamoDB Locally

I’ve found it useful to run Dynamo locally during development. It’s helpful during new feature development and experimentation (doesn’t matter if you break things and need to start again from scratch). Other benefits include being a nice person in a shared environment and also saving money is always good :)

I’ve added some helper scripts on GitHub for easily initializing new tables and dumping their contents. For Java development, you’ll also want something like the following:

// import java.net.URI;
// import org.springframework.web.util.UriComponentsBuilder;
// import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient;

URI uri = UriComponentsBuilder.newInstance()
    .scheme("http")
    .host("localhost")
    .port("8000")
    .build().toUri();

DynamoDbAsyncClient client = DynamoDbAsyncClient.builder()
    .endpointOverride(uri)
    .build();