Is there anyway to support more than 2 keys in a DynamoDB table? I have assessments that user fill and I need to index by user and assessment (several types of assessment each with different unique names). However, I also want to allow users to store different answers to each assessment (e.g. different dates or different contexts) My data structure for assessment answers is:
- Sort key["S"]: IDUser (User ID from AWS Cognito that has answered)
- Range key["S"]: IDAssessment (unique assessment name)
- Answers["M"] in which the different answers to the assessment are stored
- Additional key ["S"]: to differentiate between assessments by name or date
My data structure for assessments schemas (that define a schema) is:
- Sort key["S"]: IDAssessment (unique assessment name)
- Range key["S"]: IDUser (User ID from AWS Cognito that owns the assessment)
- Additional key ["S"]: to classify the assessments by types and access them by type
- Name["S"] of the assessment
- Categories["M"] the map containing the assessment questions and levels
I think that requires at least three keys in Dynamo DB (user, assessment, answer-name) however it only allows me to create a sort and range key Is there any way to do it? Am I missing something? Thanks everyone