DynamoDB Staging/Production/Development versions

2019-05-09 02:19发布

问题:

It seems that there is no way to create a database in Amazon DynamoDB with its own name, you can only create tables.

But we would like to separate databases for Staging/Development/Production environments.

How you resolved it? Created a new AWS account?

thanks

回答1:

I would recommend creating a separate DynamoDB account. It's good for a whole number of reasons:

  • Assurance that test data isn't leaking into production (don't give prod credentials to test hosts)
  • Ability to break out spending on test infrastructure from production
  • Inability to break prod functionality with test bugs
  • Guarantee that developers without priviledge can't see secure production data (if necessary).


回答2:

Besides creating a new AWS account you can use prefixes for Dynamo tables. For example, production-users, test-users, etc.

However, for development purposes I'd recommend to use DynamoDB Local with jcabi-dynamodb-maven-plugin. The plugin starts a local version of DynamoDB before your integration tests and shuts it down right after. Much more convenient and stable than relying on a "test" table in DynamoDB.