99x / 99x/serverless-dynamodb-local

Table Items not persisted across server starts

Open
#253 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
621
Forks
232
PR merge metrics
No merged PRs in 30d

Description

**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.

Contributor guide

Open the contributing guide

Research direction

Start with the serverless.yml dynamodb.start configuration, especially the inMemory and migrate settings. Reproduce the issue with sls offline start and sls dynamodb start by inserting items, restarting, and scanning the table. Done means existing table data remains available after either restart command.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.