DynamoDB Query ConsistentRead boundary: per-page strong consistency without cross-page snapshot
0 reputation · 15 Mar 2025, 23:39 UTC
Goal
Paginate a large DynamoDB Query result set bounded by a partition-key equality and optional sort-key range while preserving a stable read view across pages.
Constraint
DynamoDB enforces a 1 MB response limit per Query page and returns LastEvaluatedKey for continuation through ExclusiveStartKey. ConsistentRead=true makes each individual page strongly consistent, but the service does not document point-in-time snapshot isolation across multiple pages. Items inserted, updated, or deleted between fetches can appear, disappear, or change on later pages.
Uncertainty
Assuming current DynamoDB API behavior, it is unresolved whether an application should narrow the sort-key boundary and accept newly written items appearing between pages, or use a single-page atomic read pattern instead. The boundary between per-page strong consistency and cross-page visibility remains a design decision.
Does DynamoDB guarantee that consecutive Query pages with ConsistentRead=true reflect a single point-in-time snapshot? If not, which bounded Query pattern best approximates a stable large-dataset read without scanning the full table? Is TransactGetItems the only supported atomic alternative for reading multiple items consistently?