accesspatterns.dev

The key is the address

GetItem needs the whole primary key: partition and sort.

Why

This table has a composite key: a partition key (pk, the room) and a sort key (sk, the message). The partition key decides which partition an item lives on; the sort key orders items within that partition.

GetItem fetches exactly one item, and it needs the whole key. Knowing only the room is not enough to GetItem a message. That is a job for Query, next.

Know the full key, pay for one item. GetItem is the cheapest read DynamoDB offers.

Chat

These rows are real and already here. Running an operation against them downloads a DynamoDB-compatible engine, about 850 KB, and executes it in this tab.

Try an example

The full key: the room (partition) and the message id (sort). One item, the cheapest read there is.

pk(pk)
sk(sk)
topic
from
text
ROOM#general
METAS
Anything goesS
ROOM#general
MSG#2026-06-01T09:00S
adaS
morning allS
ROOM#general
MSG#2026-06-01T09:05S
linusS
coffee firstS
ROOM#general
MSG#2026-06-01T11:20S
graceS
standup in 10S
ROOM#general
MSG#2026-06-01T15:40S
adaS
PR up for reviewS
ROOM#general
MSG#2026-06-02T08:30S
linusS
merged, thanksS
ROOM#general
MSG#2026-06-02T14:00S
graceS
ship itS
ROOM#general
MSG#2026-06-02T16:15S
adaS
deploying nowS
ROOM#general
MSG#2026-06-03T09:10S
graceS
all greenS
ROOM#random
METAS
Off topicS
ROOM#random
MSG#2026-06-01T12:00S
adaS
lunch?S
ROOM#random
MSG#2026-06-01T12:30S
linusS
tacosS
ROOM#random
MSG#2026-06-02T17:00S
graceS
weekend plans?S
ROOM#random
MSG#2026-06-03T13:00S
adaS
hikingS
ROOM#design
METAS
Design critsS
ROOM#design
MSG#2026-06-01T10:00S
maraS
new mock in figmaS
ROOM#design
MSG#2026-06-02T11:00S
adaS
love the spacingS
ROOM#design
MSG#2026-06-02T13:30S
maraS
tweaked the typeS
ROOM#support
METAS
Customer issuesS
ROOM#support
MSG#2026-06-01T08:00S
samS
ticket 1042 escalatedS
ROOM#support
MSG#2026-06-02T09:30S
samS
resolvedS
ROOM#support
MSG#2026-06-03T10:00S
adaS
nice workS

Run an operation to see the raw engine response.

table Chatkeys pk / skitems 22