You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When customizing secondary indexes with .secondaryIndexes((index) => [index("GSI-pk")]) by following the documentation, we need a way to configure the ProjectionType(KEYS_ONLY, INCLUDE , or ALL), for example, add a method .projection(<type>, [fields]?), so that we could specify which fields would be projected into our GSI tables.
By the time I am writing, the amplify backend will provision our GSIs with ProjectionType of ALL, which in my opinion is not recommended, because it might incur higher storage costs and could slow down write operations on the base table since updates will be replicated across all GSIs.
Use case
In my case, I am designing my table following one-table design, which contains multiple GSI tables. However, as I mentioned above, right now the amplify backend would provision GSIs with projectionType of ALL, which means my table data would be replicated for multiple times, which could incur a lot costs.
In addition, the projectionType cannot be modified once the GSI is provisioned, which means I either have to manually delete those GSIs and re-create them with proper ProjectionType or create those GSIs myself via aws console, cli, scripts, or custom resource
The text was updated successfully, but these errors were encountered:
MyNameIsTakenOMG
changed the title
Add an option of ProjectionType for Dynamodb Global Secondary Index (Amplify Gen2)
[Feature Request]Add an option of ProjectionType for Dynamodb Global Secondary Index (Amplify Gen2)
Oct 11, 2024
Environment information
Describe the feature
When customizing secondary indexes with
.secondaryIndexes((index) => [index("GSI-pk")])
by following the documentation, we need a way to configure theProjectionType
(KEYS_ONLY
,INCLUDE
, orALL
), for example, add a method.projection(<type>, [fields]?)
, so that we could specify which fields would be projected into our GSI tables.By the time I am writing, the amplify backend will provision our GSIs with
ProjectionType
ofALL
, which in my opinion is not recommended, because it might incur higher storage costs and could slow down write operations on the base table since updates will be replicated across all GSIs.Use case
In my case, I am designing my table following
one-table design
, which contains multiple GSI tables. However, as I mentioned above, right now the amplify backend would provision GSIs withprojectionType
ofALL
, which means my table data would be replicated for multiple times, which could incur a lot costs.In addition, the
projectionType
cannot be modified once the GSI is provisioned, which means I either have to manually delete those GSIs and re-create them with properProjectionType
or create those GSIs myself via aws console, cli, scripts, or custom resourceThe text was updated successfully, but these errors were encountered: