DynamoDB ItemCollectionSizeLimitExceededException

TL;DR — Only tables with a Local Secondary Index (LSI) have this limit: all items sharing one partition key (the "item collection") can total at most 10 GB. One of your partition keys crossed it. Redesign so no single partition key accumulates unbounded data — or drop the LSI.

What it means

ItemCollectionSizeLimitExceededException: Item collection size limit exceeded.

An item collection is every item with the same partition key, including their LSI projections. Tables without an LSI have no per-collection size cap (only the table's total is unbounded). Tables with an LSI cap each collection at 10 GB, and this error means a write would push one collection past it.

Why it happens

  • A hot/unbounded partition key — one key (a big tenant, a popular user) accumulates far more items than others.
  • An LSI you may not need — the 10 GB cap exists only because the table has an LSI.
  • Append-only growth under a single partition key over time.

How to fix it

  1. Re-shard the partition key. Split the oversized entity across multiple partition keys (e.g. TENANT#42#1, TENANT#42#2) so no single collection grows unbounded.
  2. Replace the LSI with a GSI. GSIs have their own partition key and no item-collection size limit — for most access patterns a GSI is the better choice anyway (and can be added/removed after table creation, unlike an LSI).
  3. Archive cold items out of the hot collection (to a separate table or S3).

Console なしで DynamoDB を扱う

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