Reputation: 6461
There are 5 columns in my Table "Banners".
id(string) | createdAt(Date) | caption(string) | isActive(binary) | order(Int)
For now, id is the partition key and primary key.
In the future, I might want to do something like getting all banners with isActive =1 and sorted by order.
As far as I understand, GSI is the another option for partition key, LSI is like the second sort key with unchanged partition key in the table.
Should isActive be GSI and order be LSI?
Upvotes: 1
Views: 428
Reputation: 12259
Here is my rule of thumb when it comes to the LSI: only use it when you
Otherwise, use the GSI without any hesitation.
Upvotes: 1