AWS DynamoDB Multi-Tenant Table Schema

1.4k views Asked by At

Thanks in advance!

I want to ceate a Saas solution using AWS for multiple tenants each having multiple users. Each of the user (Example : Admin, Manager, Supervisor) have to upload their department users data (Eg: Name, SurName, Email, Phone etc. and these user attributes together are identified by a HashKey)

In short I have to store all users's information of multiple departments of multiple companies including each users HashKey

How can this be done using DynamoDB? Can someone help in creating a Table schema?

Query pattern mostly used is : A tenant will provide HashKey and would want to fetch all user information from it or part of it by providing HashKey and some fields.

Regards,

1

There are 1 answers

1
Bruno Castro On

You can use only one table and "separate" the data using dynamodb index. Create an Index that will be responsible for storing the tenant hash (id, whatever) and then use it to fetch the data when needed.