Do GSI not projected attributes use WRU?

0

I'm new to AWS and NoSQL/DynamoDB. I was wondering if having a GSI with projection type KEYS_ONLY whould use WRU or incur in extra cost when modifying non-key attributes in the original table.

For example if a table with PK "id" and GSI-PK "email" would get extra WRU used or cost added when modifying the attribute "city" in the original table.

Thank you in advance.

1개 답변
4
수락된 답변

This is where item size comes into play. Each write request to DynamoDB is rounded up to the nearest 1KB. So lets first assume the items in your table is less than 1KB:

A write to the base table will consume 1 WCU and replication to a GSI will consume 1 WCU. That replicated write to the GSI will consume 1WCU regardless if you use KEYS_ONLY or ALL projection, as the minimum consumption is 1 WCU.

Now consider your item size is 4KB: A write to the base table will consume 4 WCU and replication to a GSI will consume 4 WCU if using ALL projection. However, if you use KEYS_ONLY you will only consume 1 WCU from your GSI which is 1/4 of the cost of using ALL.

The second factor for using KEYS_ONLY is storage costs, only storing the keys of the item can significantly reduce storage costs as your table scales to TB's.

For example if a table with PK "id" and GSI-PK "email" would get extra WRU used or cost added when modifying the attribute "city" in the original table.

Using KEYS_ONLY would not consume GSI capacity in this instance, as you have made no changes to the indexed item.

profile pictureAWS
전문가
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠