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?
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With