Skip to content
← All patterns

education

University Portal

Who is enrolled on this course?

Enrol students on courses, assign professors and record grades.

Students, professors, departments, courses, assignments and grades share one table. Enrolment and teaching items link people to courses, and an index on each reads the link from the other end, so the same items list a student's courses and a course's students.

The model

Student

A registered student with academic records

pk
STUDENT#<studentId>
sk
STUDENT#<studentId>

Attributes: PK (S), SK (S), studentId (S), firstName (S), lastName (S), email (S), departmentCode (S), enrollmentYear (N), status (S), gpa (N), creditsCompleted (N)

Course

A course offering for a specific semester

pk
COURSE#<courseCode>
sk
SEMESTER#<semesterId>

Attributes: PK (S), SK (S), GSI3PK (S), GSI3SK (S), courseCode (S), semesterId (S), title (S), departmentCode (S), credits (N), capacity (N), enrolledCount (N), schedule (M), description (S)

Professor

A faculty member who teaches courses

pk
PROFESSOR#<professorId>
sk
PROFESSOR#<professorId>

Attributes: PK (S), SK (S), professorId (S), firstName (S), lastName (S), email (S), departmentCode (S), title (S), officeLocation (S), officeHours (M)

Department

An academic department offering courses

pk
DEPT#<deptCode>
sk
DEPT#<deptCode>

Attributes: PK (S), SK (S), deptCode (S), name (S), building (S), chairProfessorId (S)

Enrolment

Links a student to a course (adjacency list edge)

pk
STUDENT#<studentId>
sk
ENROLL#<courseCode>#<semesterId>

Attributes: PK (S), SK (S), GSI1PK (S), GSI1SK (S), studentId (S), courseCode (S), semesterId (S), status (S), enrolledAt (S)

Assignment

A graded assignment for a course

pk
COURSE#<courseCode>#<semesterId>
sk
ASSIGN#<assignmentId>

Attributes: PK (S), SK (S), assignmentId (S), courseCode (S), semesterId (S), title (S), description (S), maxPoints (N), weight (N), dueDate (S), type (S)

Grade

A student's grade for a course

pk
STUDENT#<studentId>
sk
GRADE#<courseCode>#<semesterId>

Attributes: PK (S), SK (S), GSI4PK (S), GSI4SK (S), studentId (S), courseCode (S), semesterId (S), letterGrade (S), gradePoints (N), credits (N), finalizedAt (S)

Teaching

Links a professor to a course (adjacency list edge)

pk
COURSE#<courseCode>#<semesterId>
sk
PROF#<professorId>

Attributes: PK (S), SK (S), GSI2PK (S), GSI2SK (S), professorId (S), courseCode (S), semesterId (S), role (S)

Access patterns

  • QueryGet student's current enrolments

    List all courses a student is currently enrolled in

  • Query · GSI1Get all students in a course

    List all students enrolled in a specific course section

  • Query · GSI2Get professor's teaching schedule

    List all courses a professor is teaching

  • Query · GSI4Calculate student GPA

    Aggregate grades across all courses for GPA calculation

  • Query · GSI3Get department course catalogue

    List all courses offered by a department

  • TransactWriteItemsSubmit grade for student

    Create or update a grade record for a student in a course

  • QueryGet course assignments

    List all assignments for a course section

  • GetItemGet student details

    Fetch one student's record, with the GPA held on it.

  • QueryGet professor details

    Fetch one professor's profile and office hours.

  • QueryGet department details

    Fetch one department's name, building and chair.

Design notes

Adjacency list for M:N relationshipswhy

Enrolment and Teaching entities serve as "edges" in an adjacency list graph. This enables querying from either direction: student→courses OR course→students. Alternative would be two separate tables, but single-table keeps all data together.

Grade separate from Enrolmentwhy

Grades are stored as separate items rather than attributes on Enrolment. This enables historical grade tracking, partial grades during semester, and atomic grade updates without touching enrolment status.

Denormalised GPA on Studenttrade-off

GPA is stored directly on Student for quick read access. Trade-off: must update GPA when grades change. Alternative: calculate on-read from grades, but requires aggregation query for every student fetch.

Two keys for a coursewhy

A course is keyed COURSE#<code> with the semester in its sort key, so one Query lists every time it has run. The items that belong to one offering - its assignments, its teaching and, through GSI1, its enrolments - partition on COURSE#<code>#<semester> instead, so one offering reads without the others.

Atomic counter for enrolment countgotcha

enrolledCount uses atomic ADD operation to prevent race conditions. When a student enrols, the count is incremented atomically. Watch for the gotcha: if enrolment fails after counter increment, count can drift.

Submitting a grade is a transaction the page cannot runtrade-off

Submit grade for student is a TransactWriteItems: it puts the grade and moves the enrolment from enrolled to completed, so a grade never exists for a course the student was not enrolled on. The engine in this page does not support TransactWriteItems, so it is not offered as a run.

Taught in the course

university-portalDynamoDB workbench
Ready to run
Explore an access patternSelect to load & run

List all courses a student is currently enrolled in

Request
Execute against the local Dynoxide engine
ReturnedFiltered outChanged
PK(pk)
SK(sk)
creditsCompleted
departmentCode
email
enrollmentYear
firstName
gpa
lastName
status
studentId
GSI3PK
GSI3SK
capacity
courseCode
credits
description
enrolledCount
schedule
semesterId
title
officeHours
officeLocation
professorId
building
chairProfessorId
deptCode
name
GSI1PK
GSI1SK
enrolledAt
assignmentId
dueDate
maxPoints
type
weight
GSI4PK
GSI4SK
finalizedAt
gradePoints
letterGrade
GSI2PK
GSI2SK
role
STUDENT#s-001
ENROLL#CS101#2024-fallS
—
—
—
—
—
—
—
enrolledS
s-001S
—
—
—
CS101S
—
—
—
—
2024-fallS
—
—
—
—
—
—
—
—
COURSE#CS101#2024-fallS
STUDENT#s-001S
2026-09-27T09:30:00ZS
—
—
—
—
—
—
—
—
—
—
—
—
—
STUDENT#s-001
GRADE#CS100#2024-springS
—
—
—
—
—
—
—
—
s-001S
—
—
—
CS100S
3N
—
—
—
2024-springS
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
STUDENT#s-001S
GRADE#2024-springS
2026-07-02T16:00:00ZS
4N
AS
—
—
—
STUDENT#s-001
STUDENT#s-001S
60N
CSS
emily.zhang@university.eduS
2022N
EmilyS
3.75N
ZhangS
activeS
s-001S
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
STUDENT#s-002
STUDENT#s-002S
30N
MATHS
james.kim@university.eduS
2023N
JamesS
3.5N
KimS
activeS
s-002S
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
COURSE#CS101
SEMESTER#2024-fallS
—
CSS
—
—
—
—
—
—
—
DEPT#CSS
COURSE#CS101S
60N
CS101S
3N
Fundamentals of programming and computational thinkingS
45N
{3}M
2024-fallS
Introduction to Computer ScienceS
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
PROFESSOR#prof-001
PROFESSOR#prof-001S
—
CSS
m.johnson@university.eduS
—
MichaelS
—
JohnsonS
—
—
—
—
—
—
—
—
—
—
—
Associate ProfessorS
{2}M
EH-305S
prof-001S
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
DEPT#CS
DEPT#CSS
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
Engineering HallS
prof-001S
CSS
Computer ScienceS
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
DEPT#MATH
DEPT#MATHS
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
Science CentreS
prof-003S
MATHS
MathematicsS
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
COURSE#CS101#2024-fall
ASSIGN#hw-001S
—
—
—
—
—
—
—
—
—
—
—
—
CS101S
—
Write your first Python programS
—
—
2024-fallS
Hello World ProgramS
—
—
—
—
—
—
—
—
—
—
hw-001S
2026-10-28S
100N
homeworkS
5N
—
—
—
—
—
—
—
—
COURSE#CS101#2024-fall
PROF#prof-001S
—
—
—
—
—
—
—
—
—
—
—
—
CS101S
—
—
—
—
2024-fallS
—
—
—
prof-001S
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
PROFESSOR#prof-001S
COURSE#CS101#2024-fallS
primaryS
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.

Write transactions, streams, tags and TTL are among the operations this browser build leaves out. dynoxide's native build has them.