O'Reilly logo

DynamoDB Applied Design Patterns by Prabhakaran Kuppusamy, Uchit Vyas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Best practices with secondary indexes

There are four rules to create the secondary index so that our table will function without any hiccups. These rules are as follows:

  • Distributing the load by choosing the correct key
  • Making use of the sparse index
  • Using the global secondary index for quicker retrieval
  • Creating a read replica

Distributing the load by choosing the correct key

In the case of a multipartition table, the data as well as the table's associated indexes will be distributed across servers. This distribution of indexes across servers is determined by the value of one of the attributes of the index. Yes, you're correct: it is decided by the hash key value. Unlike the hash key value (compounded with the range key) of a table, indexes keys can ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required