javascriptnode.jsamazon-dynamodbdynamo-local

DynamoDB Local deletes data after shutting down instance


I'm using DynamoDB Local for my app, and it keeps deleting all the sample data every time I shut down the instance. Does anyone know why this happens? I've tried to look it up, but I don't see anyone else has this issue. I've used the downloadable version of dynamodb and use this command dynamodb_local_latest baopham$ java -Djava.library.path=./DynoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb -inMemory to start and instance. Am I missing anything? Thank you.


Solution

  • DynamoDB local usage documentation clearly states that if use -inMemory option, data will be in memory and data will be lost when you terminate. Take out -inMemory option in your command.

    If you use the -inMemory option, DynamoDB does not write any database files at all. Instead, all data is written to memory, and the data is not saved when you terminate DynamoDB.