Skip to content

A different key for a different question

A secondary index re-keys your items so you can Query them on a new axis.

Why

The base table groups tickets by project. But 'every ticket assigned to Ada, across all projects' needs a different partition key, and you cannot change the table's keys.

A global secondary index is the answer: it is an automatically-maintained, re-keyed copy of your items. Query the base table for a project; Query the index for an assignee. Same items, two axes.

An index is a re-keyed copy of your data. Add one when an access pattern needs a key the table does not have.

Try it. Then change it.

Predict what each request will do. Run it, inspect the response, then change a value in the workbench and try again.

  1. The base table is keyed by project, so 'this project's tickets' is a Query on the table.

  2. 'Everything assigned to Ada' crosses projects, so the table's keys can't answer it, but the by-assignee index can.

Built on this

TicketsDynamoDB workbench
Ready to run
Explore an access patternSelect to load & run

The base table is keyed by project, so 'this project's tickets' is a Query on the table.

Request
Execute against the local Dynoxide engine
ReturnedFiltered outChanged
pk(pk)
sk(sk)
title
status
gsi1pk
PROJECT#web
TICKET#101S
Fix the footerS
openS
USER#adaS
PROJECT#web
TICKET#102S
Dark modeS
openS
USER#graceS
PROJECT#web
TICKET#103S
Old redirectS
closedS
—
PROJECT#web
TICKET#104S
Mobile navS
openS
USER#adaS
PROJECT#web
TICKET#105S
FaviconS
closedS
—
PROJECT#web
TICKET#106S
Cookie bannerS
openS
USER#samS
PROJECT#api
TICKET#201S
Rate limitS
openS
USER#adaS
PROJECT#api
TICKET#202S
Retire v1S
closedS
—
PROJECT#api
TICKET#203S
PaginationS
openS
USER#graceS
PROJECT#api
TICKET#204S
Audit logS
closedS
—
PROJECT#api
TICKET#205S
WebhooksS
openS
USER#adaS
PROJECT#mobile
TICKET#301S
Push notificationsS
openS
USER#adaS
PROJECT#mobile
TICKET#302S
Crash on launchS
closedS
—
PROJECT#mobile
TICKET#303S
Offline modeS
openS
USER#samS
PROJECT#mobile
TICKET#304S
Biometric loginS
closedS
—
PROJECT#data
TICKET#401S
Nightly exportS
openS
USER#graceS
PROJECT#data
TICKET#402S
Schema driftS
closedS
—
PROJECT#data
TICKET#403S
Backfill ordersS
openS
USER#adaS
PROJECT#data
TICKET#404S
Dedupe usersS
closedS
—
PROJECT#data
TICKET#405S
Archive logsS
openS
USER#samS
Awaiting request
Your next query starts here.

Choose an access pattern above, or build your own request. See what comes back and what it costs.

Powered by DynoxideWASMStarts on your first run · Runs locally in your browser