A Single-Table DynamoDB Model
Access patterns first, schema second
Abstract
This paper works through a single-table DynamoDB design from access patterns to keys, GSIs, and the cost model that makes it attractive for a zero-cost-when-idle stack. It is a draft: the entity set is stable but the overloaded index strategy is still being validated against real query volume.
Why single-table
Relational instincts say “one table per entity.” DynamoDB rewards the opposite: co-locating related entities in a single table lets you satisfy a query with one request and no joins.1 The cost is up-front design effort — you must know your access patterns before you choose keys.
Access patterns
Design begins with a list of questions the application asks, not with entities:
| # | Access pattern | Frequency |
|---|---|---|
| A1 | Get a paper by id | High |
| A2 | List papers in a collection, newest first | High |
| A3 | List papers by author | Medium |
| A4 | List papers carrying a topic | Medium |
| A5 | Get an author profile | Low |
The model
Two entities — Paper and Author — share one table. The primary key is
overloaded: PK/SK mean different things per item type.
PK (string, overloaded)SK (string, overloaded)GSI1PK / GSI1SK (collection + date, author lookups)The item shapes:
Paper PK = PAPER#<id> SK = PAPER#<id>
GSI1PK = COLLECTION#<name> GSI1SK = DATE#<iso8601>
Author PK = AUTHOR#<handle> SK = AUTHOR#<handle>
Membership PK = PAPER#<id> SK = AUTHOR#<handle> (A3)
Resolving each pattern
- A1 —
GetItemonPK = PAPER#<id>, SK = PAPER#<id>. - A2 —
QueryGSI1 onGSI1PK = COLLECTION#<name>,ScanIndexForward=falsefor newest-first. - A3 —
QueryGSI1 onGSI1PK = AUTHOR#<handle>(the membership items carry an author-scoped GSI1PK). - A4 — topics are low-cardinality and queried rarely; a sparse
GSI2keyed onTOPIC#<name>covers A4 without bloating GSI1.
Cost model
On-demand billing means there is no provisioned-capacity floor: an idle table costs only storage, which for a document catalog is negligible.2 Reads and writes are billed per request, so the bill scales with actual traffic — the same zero-idle property the rest of the stack targets.
Open questions
- Does GSI1 overloading survive real author-listing volume? (§4)
- Should topic membership be denormalized onto the paper item to drop GSI2?
- Is a TTL attribute warranted for superseded drafts?
References
- (2022). The DynamoDB Book. self-published.
- (2024). Single-table vs. multi-table design in DynamoDB. Amazon DynamoDB Developer Guide.
Cite this paper
Jon (2026). A Single-Table DynamoDB Model (v0.3). Prosyon Research. https://research.prosyon.ca/papers/single-table-dynamodb/