accesspatterns.dev
← All models

general

Maintainers & Projects

A many-to-many between people and projects, read from either side.

Memberships are stored once, as edge items keyed by person then project. An inverted index swaps the keys, so 'a person's projects' reads the base table and 'a project's maintainers' reads the index, from the very same edges, with nothing duplicated.

The model

Membership

An edge: a person maintains a project, in a role.

pk
PERSON#<personId>
sk
PROJECT#<projectId>

Attributes: personId (S), projectId (S), role (S)

Access patterns

  • QueryProjects a person maintains

    List the projects a person maintains.

  • Query · GSI1Maintainers of a project

    List the people who maintain a project.

Design notes

One edge, two directionswhy

Each membership is a single item carrying both key pairs: PK/SK by person, GSI1PK/GSI1SK by project. The base table answers 'a person's projects' and the inverted index answers 'a project's maintainers'.

Inverting the keyshow

The index swaps the two: its partition key is the edge's project, its sort key the edge's person. Reading the relationship from the other end is the same query against a different index.

Taught in the course

maintainers-projects

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

List the projects a person maintains.

PK(pk)
SK(sk)
GSI1PK
GSI1SK
role
PERSON#ada
PROJECT#httpkitS
PROJECT#httpkitS
PERSON#adaS
reviewerS
PERSON#ada
PROJECT#zlib2S
PROJECT#zlib2S
PERSON#adaS
leadS
PERSON#raj
PROJECT#dataframeS
PROJECT#dataframeS
PERSON#rajS
reviewerS
PERSON#raj
PROJECT#httpkitS
PROJECT#httpkitS
PERSON#rajS
leadS
PERSON#mei
PROJECT#dataframeS
PROJECT#dataframeS
PERSON#meiS
leadS

Run an operation to see the raw engine response.

table maintainers-projectskeys PK / SKitems 5

Transactions, streams, tags and TTL are among the operations the in-browser engine doesn't implement yet.