Yan Cui
1 min readApr 4, 2019

--

I see what you meant now! You’re right, it’s not supported by this scheme, which is for paging through results sequentially.

The type of paging you describe would be difficult to support using DynamoDB. And you absolutely shouldn’t rely on scan operations — they’re slow, and expensive and do not scale well at all. If this is a must for you, and you have to use DynamoDB, I think a better approach would be to construct the pages whenever new content is added — i.e. use DynamoDB Stream to invoke a Lambda when content is added/removed.

Maybe you can store the pages in a separate DynamoDB row. Since the row size limit is 400KB, and you only need to store the keys in each page, you can probably fit all the keys in one row. But to make the reads more efficient (cost and speed-wise), you will probably want to store each page as a separate row.

--

--

Yan Cui
Yan Cui

Written by Yan Cui

AWS Serverless Hero. Follow me to learn practical tips and best practices for AWS and Serverless.

No responses yet