0

i am trying to use dynamoDb in an Android app. i have an item in a table. this item has a StringSet attribute. let's say for argument's sake, that this string set contains one million items. what is the most efficient way of getting 4 random items out of this set? thanks regards clive

1 Answer 1

1

You cannot have one million strings in a single record, there is a per record size limitation.

This is how you can solve it.

string (PARTITION KEY), sequentialnumber (RANGE KEY), any extra attributed for this record.

Generate 4 random numbers ( 1 to 1 million ) and query for records, with the string and random number to dynamo.

This would solve your problem.

It is not efficient to search a record with million of items inside inside it.

Sign up to request clarification or add additional context in comments.

1 Comment

thanks. i just used an example of 1 million records to indicate that the item has a large number of items.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.