Skip to content

Implement query batching for teacher and student pages#69

Merged
CarterT27 merged 1 commit into
mainfrom
CarterT27/query-batching
Jan 21, 2026
Merged

Implement query batching for teacher and student pages#69
CarterT27 merged 1 commit into
mainfrom
CarterT27/query-batching

Conversation

@CarterT27
Copy link
Copy Markdown
Owner

Summary

Reduce network latency by batching multiple queries into single endpoints.

  • Teacher page: 4 independent queries → 1 batched query (getTeacherPageData)
  • Student page: 5 independent queries → 1 batched query (getStudentPageData)
  • Reuse student data internally to compute both student count and lost student count, improving database efficiency

Improvements

  • 75% reduction in query round trips on teacher page
  • 66% reduction in query round trips on student page
  • Backwards-compatible destructuring maintains existing component code

- Add getTeacherPageData: combines session, student counts, and active quiz (4 queries → 1)
- Add getStudentPageData: combines session, transcript, quiz, and student state (5 queries → 1)
- Update teacher page to use batched query
- Update student page to use batched query
- Reuse student data for both count calculations, improving efficiency

Reduces network round trips and latency for initial page loads.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying waitwhat with  Cloudflare Pages  Cloudflare Pages

Latest commit: d05d35e
Status: ✅  Deploy successful!
Preview URL: https://009ff021.waitwhat-e0v.pages.dev
Branch Preview URL: https://cartert27-query-batching.waitwhat-e0v.pages.dev

View logs

@CarterT27 CarterT27 merged commit 4041547 into main Jan 21, 2026
2 checks passed
@CarterT27 CarterT27 deleted the CarterT27/query-batching branch January 21, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant