Adapting Pagination from SQL Server to Amazon DynamoDB for .NET Applications
.NET on AWS Blog
This article explains how to adapt pagination patterns from SQL Server to Amazon DynamoDB for .NET applications, comparing offset-based and token-based pagination models.
- SQL Server uses offset-based pagination with row positions; DynamoDB uses token-based continuation with LastEvaluatedKey
- Page number navigation requires sequential scanning to simulate jumps; costs increase linearly with page depth
- Previous/next navigation maps directly to DynamoDB's model; maintains consistent per-page costs without filters
- Infinite scrolling accepts variable batch sizes; reduces API calls and simplifies filter handling
- FilterExpression applies after items are read, affecting page size consistency and RCU consumption
- Replace page numbers with serialized continuation tokens; remove total count properties for cost efficiency
- Choose pattern based on UI requirements, navigation depth, filter selectivity, and cost constraints
Migrating pagination to DynamoDB requires aligning design with token-based architecture and actual access patterns rather than forcing offset-based patterns onto distributed systems.
The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.
Related articles
The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.