In my previous article about DynamoDB data modeling, I mentioned three methods that we can use to determine the secondary indexes if need.

  1. Inverted Index
  2. GSI Overloading
  3. Sparse Index

Now I’ve decided to have an in-depth look at these methods using an example and explain the scenarios under which we can employ each method.


Inverted Index

Image for post

Inverted indexes are used to model many to many relationships in DynamoDB data modeling. Let’s take the same example as the previous article.

Image for post

We can see that there is a many to many relationship between Employee and Project entities which means a single employee can work in multiple projects and a single project contains multiple employees. We can further break this relationship follows,

#dynamodb #data-modeling #guides-and-tutorials #technology #aws #data analysis

Inverted index, GSI overloading, and Sparse index in DynamoDB
8.00 GEEK