Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Projected attributes ALL vs Key only vs Include

While creating secondary Index in Dynamodb, there is label named Projected attributed with following list

 Projected attributed         
                     ALL
                     key only
                     Include

How all these affects(in terms of cost and performance) with LSI and GSI?

like image 728
anna poorani Avatar asked Jun 25 '17 06:06

anna poorani


People also ask

What are projected attributes?

Attribute projections. A projection is the set of attributes that is copied from a table into a secondary index. The partition key and sort key of the table are always projected into the index; you can project other attributes to support your application's query requirements.

What is the difference between LSI and GSI?

Primary key of a GSI can be a single attribute key which is called a partition key or it can be a composite key with two attributes, the partition key and the sort key. Primary key of a LSI has to be a composite key, a combination of the partition key and sort key.

What is projection type DynamoDB?

When setting up an index, DynamoDB will allow three data projection options. A data projection is a definition of which item attributes are projected – or copied – into the index: Key-only projection: only the primary-key and sort-key item attributes will be available in index.

What techniques should you use to secure Amazon DynamoDB?

Use the DynamoDB Encryption Client for client-side encryption, in which you encrypt your table data before you send it to DynamoDB. You may choose to do this based on your data's sensitivity and your application's security requirements. For more information, see Client-Side and Server-Side Encryption.


1 Answers

KEYS_ONLY – Each item in the index consists only of the table partition key and sort key values, plus the index key values. The KEYS_ONLY option results in the smallest possible secondary index.

INCLUDE – In addition to the attributes described in KEYS_ONLY, the secondary index will include other non-key attributes that you specify.

ALL – The secondary index includes all of the attributes from the source table. Because all of the table data is duplicated in the index, an ALL projection results in the largest possible secondary index.

like image 77
anisha raj Avatar answered Oct 02 '22 20:10

anisha raj