Sample Application, with CRUD operations using DynamoDB(NoSQL database) SDK AWS Resource.
We have 2 options to start dynamoDB local
-
Command in Terminal
Download and Extract zip before execute command...
Go to directory extracted and execute:
java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb
-
With Docker Compose
We have a docker-compose.yml with steps to run
docker-compose up
- To verify dynamodb local is working access in browser
localhost:8000/shell
-
Create Table
aws dynamodb create-table --cli-input-json file://music_table.json --endpoint-url=http://localhost:8000
- Verify if tabla was created with success:
aws dynamodb list-tables --endpoint-url=http://localhost:8000
-
Populate data with POST
- url:
localhost:8080/aws/dynamo/musics
- body request:
{ "id":"1", "artist": "Vittoria", "songTitle": "Go DynamoDB", "albumTitle": "AWS", "year": 2021 }
- HTTP Status 201
- url:
-
Verify Registration in Table
aws dynamodb scan --table-name Music --endpoint-url http://localhost:8000