accesspatterns.dev

One table, an application's worth of questions

Generic keys and one overloaded index answer five access patterns with no join and no scan.

Why

This is the whole course in one table. A conference platform has conferences, sessions, speakers and registrations, and five questions to answer. Every item lives in one table, keyed generically, with one overloaded index, GSI1, shared across two entity types.

Run the five examples. A conference and its agenda are one Query; a session and its attendees are another. GSI1 re-keys sessions by speaker and registrations by attendee, so the same index answers both 'every talk this speaker gives' and 'every session this attendee booked'. The fifth is a plain GetItem. Five access patterns, every one a Query or a GetItem, never a join and never a scan.

Model backwards from your access patterns: generic keys and one overloaded index let a single table serve an entire application.

Conference

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

A conference and its sessions share a partition, so one Query returns the lot, sessions in start-time order.

pk(pk)
sk(sk)
name
city
gsi1pk
gsi1sk
title
room
meal
CONF#north26
CONF#north26S
NorthConf 2026S
LeedsS
CONF#north26
SESS#2026-09-10T09:00#s1S
SPEAKER#okaforS
SESS#2026-09-10T09:00S
WASM at the edgeS
AS
CONF#north26
SESS#2026-09-10T11:00#s2S
SPEAKER#meiS
SESS#2026-09-10T11:00S
Vector searchS
BS
CONF#north26
SESS#2026-09-10T14:00#s3S
SPEAKER#okaforS
SESS#2026-09-10T14:00S
Edge cachingS
AS
CONF#south26
CONF#south26S
SouthConf 2026S
BristolS
CONF#south26
SESS#2026-11-02T10:00#s4S
SPEAKER#rajS
SESS#2026-11-02T10:00S
Rust for dataS
MainS
SESS#s1
REG#danaS
ATTENDEE#danaS
REG#north26#s1S
vegS
SESS#s1
REG#lenaS
ATTENDEE#lenaS
REG#north26#s1S
noneS
SESS#s2
REG#danaS
ATTENDEE#danaS
REG#north26#s2S
vegS
SESS#s4
REG#omarS
ATTENDEE#omarS
REG#south26#s4S
halalS

Run an operation to see the raw engine response.

table Conferencekeys pk / skitems 10