0
votes

Suppose I have the following object on DynamoDB. This object is a map of maps, where each nested map represents an issue. The key value pair of the nested maps represent issueId:issueDetails. Now suppose there are 100s of issues (that are ever-growing or decreasing), and I only want to grab the status & criticality of each issue. How do I go about doing so?

{
    "issues": {
        "ISU000000000": {
            "impactOn": "Balance Sheets",
            "issueName": "TestIssue",
            "criticality": "High",
            "status": "open"
        },
        "ISU000000001": {
            "impactOn": "Balance Sheets",
            "issueName": "TestIssue",
            "criticality": "High",
            "status": "open"
        },
        "ISU000000002": {
            "impactOn": "Balance Sheets",
            "issueName": "TestIssue",
            "criticality": "High",
            "status": "open"
        }
    }
}

I understand that you can write a projection expression on DynamoDB with attribute names and values like this:

ProjectionExpression = "issues.#IssueID.criticality, issues.#IssueID.status"
ExpressionAttributeNames = {'#IssueID':'ISU000000000'}

But the thing is, in this approach I've declared the IssueID in the ExpressionAttributeNames parameter. So that means, with this approach, I'd have to declare all the IssueIDs beforehand. Is there a way to write an expression such that I don't have to declare the issueID? The end goal is to be able to grab the above-mentioned desired information in an object that dynamically changes in size (meaning issues will be added or deleted).

Note, I'm using the Boto3 SDK

Does my question make sense? Please let me know your thoughts.

1

1 Answers

0
votes

My gut feeling tells me this is a suboptimal design. What triggers me is you say it can be an ever growing map, but a single record has a limitation on 400KB for a single item. I would try to flatten the items out and avoid deep nesting if you have frequently mutating data.

Are you able to redesign so each item is it’s own issue. There are other ways to achieve multi tenancy if that is your goal.