Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
DynamoDB Applied Design Patterns

You're reading from  DynamoDB Applied Design Patterns

Product type Book
Published in Sep 2014
Publisher
ISBN-13 9781783551897
Pages 202 pages
Edition 1st Edition
Languages
Author (1):
Uchit Hamendra Vyas Uchit Hamendra Vyas

Projection


Once we have an understanding of the secondary index, we are all set to learn about projection. While creating the secondary index, it is mandatory to specify the hash and range attributes, based on which the index is created. Apart from these two attributes, if the query wants one or more attribute (assuming that none of these attributes are projected into the index), then DynamoDB will scan the entire table. This will consume a lot of throughput capacity and will have comparatively higher latency.

The following is the table (with some data) that is used to store book information:

Here are few more details about the table:

  • The BookTitle attribute is the hash key of the table and local secondary index

  • The Edition attribute is the range key of the table

  • The PubDate attribute is the range key of the index (let's call this index IDX_PubDate)

Local secondary index

While creating the secondary index, the hash and range key of the table and index will be inserted into the index; optionally...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}