This is a sample Java project that demonstrates how to use DynamoDB Local for local development and testing. DynamoDB Local is a downloadable version of DynamoDB that enables you to develop and test applications without connecting to the actual DynamoDB service provided by AWS. This project showcases multiple approaches to set up and use DynamoDB Local, including downloading JAR files, running it as a Docker image, and using it as a Maven dependency.
If you prefer to download and run DynamoDB Local as JAR files, follow these steps:
java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb
The -sharedDb
flag indicates that DynamoDB Local will use a single database file for all data and will persist between restarts.
If you prefer to use DynamoDB Local as a Docker image, follow these steps:
docker pull amazon/dynamodb-local
docker run -p 8000:8000 amazon/dynamodb-local
If you prefer to use DynamoDB Local as a Maven dependency, follow these steps:
Open the pom.xml
file in your project.
Add the following dependency to the <dependencies>
section:
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>DynamoDBLocal</artifactId>
<version><LATEST_VERSION></version>
</dependency>
You can find the latest version of DynamoDB Local here: https://mvnrepository.com/artifact/com.amazonaws/DynamoDBLocal
Build your project using Maven:
mvn clean package
See CONTRIBUTING for more information.
To report a bug or request a feature or to contact the DynamoDB Local team, reach out to us at aws-ddblocal-feedback@amazon.com.
This library is licensed under the MIT-0 License. See the LICENSE file.