AWS Certified Solutions Architect - Professional 2020

Sign Up Free or Log In to participate!

Secondary Index – consideration / benefit table 11:16

For the "Aggregations" table, you mentioned using "Period" as the primary key of GSI, but Period is not unique among the customers. Do we need to use Period + custom ID as the primary key?

Please let me know if I missed anything, thanks!

1 Answers

Hi Henry,

In that example, I was referring to being able to get an aggregate across all customers, so we would not need to include the customer id.  We could just pull Period and TotalPurchases then add them up locally.  The specific example in the AWS documentation uses a single row that’s updated frequently as a counter.  This link might help explain it better:

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-gsi-aggregation.html

–Scott

Henry Liu

I don’t think GSI can do any aggregation by itself: query using GSI with a specific period will return all customer records in that period.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?