serverless-dynamodb-local icon indicating copy to clipboard operation
serverless-dynamodb-local copied to clipboard

Table Items not persisted across server starts

Open lmuntaner opened this issue 4 years ago • 4 comments

Actual Behaviour

Configuration in serverless.yml.

  dynamodb:
    start:
      port: 8089
      migrate: true
      inMemory: false
    stages:
      - ${self:provider.stage}

After closing and starting up again serverless offline the database is restarted and all data is lost. As if it was using inMemory. But inMemory is set to false.

It seems that the tables are created after every sls offline start.

This also happens with sls dynamodb start.

Expected Behaviour

sls offline start does not create tables if they already exist.

Steps to reproduce it

  1. Start offline server
  2. Insert items into DynamoDB
  3. Close server
  4. Start offline server
  5. Scan table -> Table is empty

LogCat for the issue

None

Screenshots of the issue

None

Would you like to work on the issue?

I would love to, but it seems that there is something I am doing wrong. It doesn't seem a bug in the library.

lmuntaner avatar Jun 08 '20 09:06 lmuntaner

I'm trying to do the same thing using Docker in order to provide persistent data but this plugin is actually cannot create tables. There's a problem about migrating tables i guess. But you have to use Docker in order to provide persistent data. Check my issue: https://github.com/99xt/serverless-dynamodb-local/issues/254

lunizxx avatar Jun 08 '20 10:06 lunizxx

Yes, it seems to be a related issue.

lmuntaner avatar Jun 08 '20 12:06 lmuntaner

@Imuntaner Did you ever figure this out? I'm running into the same issue.

j0b0sapi3n avatar Dec 29 '20 07:12 j0b0sapi3n

We are using AWS docker image directly. Not this plugin anymore.

lmuntaner avatar Dec 29 '20 08:12 lmuntaner