grapl-security/grapl

Explore dumping the DynamoDB database with integration tests

Closed this issue · 1 comments

I've actually already explored this. There's two options.

Option 1: DynamoDB's CreateBackup

This is not a viable option. Listing it here for completeness.
DynamoDB has a method, CreateBackup, that dumps a single DynamoDB table. Problem is, Local DynamoDB doesn't support it.

Option 2: ondisk DB

Local DynamoDB has an option for a shared DB.
-sharedDb -dbPath /dynamodb_backup/backup.db

We could use this + do some volume mount stuff.

The docker-compose would look something like

  dynamodb:
    image: amazon/dynamodb-local
    command: "-jar DynamoDBLocal.jar -sharedDb -dbPath /dynamodb_backup/backup.db"
    volumes:
      - type: volume
        source: dynamodb_backup
        target: /dynamodb_backup

basically, I haven't been able to figure out the right variable substitution - like ${THING:-default} - combination so that I can hide this behind a SHOULD_USE_SHARED_DB= flag.

I did this with #411
it is one way - we dump the database but we don't have a way to repopulate dynamodb the way we do with dgraph (yet)