Wednesday 15 July 2015

Non diverse Global Secondary Index in DynamoDB -



Non diverse Global Secondary Index in DynamoDB -

let's assume have table next attributes:

unique user_id (primary hash key) category_id (gsi hash index) timestamp

i have lot of users, few categories.

user_id | category_id 1 1 3 1 4 1 5 3 .. .. 50000000 1

is ok store millions of records same category_id value global secondary index? should expect restrictions?

i'm wondering if scan not bad choice. utilize filtering category_id 1 time day. cost (time , money) of scanning millions of records?

thanks!

according limits documentation, limitation is:

no practical limit tables without local secondary indexes.

for table local secondary indexes, there limit on item collection sizes: every distinct hash key value, total sizes of table , index items cannot exceed 10 gb. depending on item sizes, may constrain number of range keys per hash value. more information, see item collection size limit.

now sec question of whether should doing query or scan, asked both performance , monetary cost. maintaining gsi expensive, because have pay throughput (and if recall correctly storage) paying table, plus table throughput have monitor create sure aren't beingness throttled. on other hand, performance much better.

if you're planning on going through categories 1 time day (which means every document in table), scan way go. aren't gaining querying. plus cheaper (no gsi) , don't have worry projections.

amazon-dynamodb

No comments:

Post a Comment