Multiple applications and DynamoDB, the perfect way to customize?

We plan to use DynamoDB as the noSQL database for various AWS applications, and plan to use AWS Identity and Access Management (IAM) to connect to DynamoDB.

Typically, you have one AWS account and you can create new users for each application, and you can give them access to their respective tables in DynamoDB to ensure that they cannot access or modify other application files .

My question is: can the application use the table of the same name in DynamoDB? for example LOG, so each application has its own LOG table in DynamoDB, but the data is not used? (we can achieve this in SQL-based databases by defining a schema for each application and creating a user who needs access to this schema)

Note. We do not plan to use different regions of DynamoDB and would like to know if this is possible using one region?

+6
source share
1 answer

DynamoDB does not provide namespace levels such as Database and Schema , like regular SQL RDBMS, for example. PostgreSQL , Oracle .

[hostname > ] database > schema > table

With DynamoDB, this is more like

[aws-region > aws-account-id > ] table

So, you have two options for splitting applications into DynamoDB:

1) Just use table name prefixes to split tables, an application using IAM to make sure that "application A" has only access to the tables to which it requires access.

  • Pro:
    • easy to use, only a separate section to be separated.
    • the ability to exchange DynamoDB tables between applications, if necessary
  • Con:
    • billing reporting

or

2) Use AWS split accounts.

  • Pro:
    • split billing, usage statistics, etc.
  • Con:
    • can be annoying control, for example. AWS console in / out

Note: In general, you should not hard-code DynamoDB table names in your application. Use some mapping between logical table names and real table names. for example, some variable tableName_LOG = 'AppA_LOG' .

+14
source

Source: https://habr.com/ru/post/973051/


All Articles