AWS Certified Solutions Architect - Professional 2020

Sign Up Free or Log In to participate!

secondary indexes in dynamoDB / Case “rarely query but write or update frequently”

Hi All,

i try to understand suggestions for secondary indexes in dynamoDB (Video Time 09:41)

Course: AWS Certified Solutions Architect – Professional / Chapter 2

Last row in the table: “…rarely query but write or update frequently”

Why it will be very fast write or updates?

What is aim of GSI in that case / why do we need it? (rarely query ==> scan can be ok)

I understand it so:

  • we define GSI that includes required attributes (for search) and primary key from table

  • if we want to update some item(s):

   o we search single or multiple items based on additional attributes in GSI

   o take primary key(s) and in separate request update item(s) in

What do think?

P.S. Developer guide contains following:

If your application needs to query a table infrequently, but must perform many writes or updates against the data in the table, consider projecting KEYS_ONLY. The global secondary index would be of minimal size, but would still be available when needed for query activity.

(https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.html)

Nothing about “…be very fast write or updates”

Thanks in advance!

1 Answers

I believe this is talking about using GSIs to perform write sharding.

Basically, designing the GSI so you can write to multiple partitions to resolve write contention on a "hot partition".

You can read more here…

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

https://aws.amazon.com/blogs/big-data/scaling-writes-on-amazon-dynamodb-tables-with-global-secondary-indexes/

https://www.dynamodbguide.com/leaderboard-write-sharding/

There also an excellent DynamoDB class here on ACG that really solidified my DynamoDB knowledge and helped me design and implement it into several solutions.

https://acloud.guru/learn/aws-dynamodb

Sign In
Welcome Back!

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

Get Started
Who’s going to be learning?