Chapter 4. Working with Secondary Indexes

In the previous chapter, we saw how to work with DynamoDB SDK. We discussed table creation, item insertion, and updating a table using Java SDK. During table creation, we used two functions to create the local and global secondary indexes that we will discuss now.

Note

Projection helps the programmer to decide which attributes have to be added to the secondary index.

Understanding the secondary index and projections should go hand in hand because of the fact that a secondary index cannot be used efficiently without specifying projection. In this chapter, we will cover the following topics:

  • Global secondary indexes
  • Local secondary indexes
  • Projection
  • Item sharding
  • Best practices

The use of projection in DynamoDB ...

Get DynamoDB Applied Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.