Too many items requested for the BatchGetItem call

TL;DR — BatchGetItem retrieves at most 100 items per call (and ≤16 MB of data). You requested more than 100 keys, so DynamoDB rejected the request. Split your keys into chunks of 100 or fewer and issue one BatchGetItem per chunk.

What it means

ValidationException: Too many items requested for the BatchGetItem call

BatchGetItem fetches items by primary key across one or more tables, but a single call is capped at 100 keys and 16 MB of returned data. Request more than 100 and DynamoDB rejects the whole call. Even within the limit, a response may return fewer items than asked (the 16 MB ceiling), reporting the rest in UnprocessedKeys. The over-limit case is an HTTP 400 ValidationException, not retryable until resized.

Why it happens

  • Requesting a large key set in one call — passing hundreds of keys straight into BatchGetItem.
  • A chunk bound above 100 — batching by count but using the 25-item BatchWrite limit's sibling incorrectly, or an off-by-one letting 101 through.
  • Counting tables, not keys — the 100 limit is total keys across all tables in the request.
  • Not paging UnprocessedKeys — assuming one call returns everything, so you never chunk.

How to fix it

  1. Chunk keys into groups of ≤100 and send one BatchGetItem per chunk.
  2. Handle UnprocessedKeys — retry any returned keys with exponential backoff; this happens even inside a valid 100-key batch when the 16 MB cap is hit.
  3. Keep responses under 16 MB — with large items, request fewer than 100 per call.
  4. Use a batching helper (the SDK document-client batch getters chunk and retry for you) instead of a hand-rolled loop.

Console なしで DynamoDB を扱う

DynoTable は DynamoDB 向けの高速なデスクトップクライアントです — テーブルを閲覧し、SQL スタイルのクエリを実行し、アイテムをローカルで編集できます。