Building a Waitlist with Automatic Promotion in Spring Boot (and Keeping the Queue Gap-Free)
🇺🇸 English version (🇧🇷 versão em português logo abaixo) The problem: sessions with limited spots I'm building a tutoring management system with Java, Spring Boot and PostgreSQL. Students can become tutors for a subject, and tutors open sessions with a limited number of spots. That raised a real business question: what happens when a session is full? I didn't want to just return "Session is…
The challenge lies in sessions that have a limited number of spots. In the tutoring management system built using Java, Spring Boot, and PostgreSQL, students can become tutors for a subject and open sessions with a limited number of spots. This led to the question of what happens when a session is full. The reporter wanted an optional waitlist feature, which allows students to be added to a queue if there are no spots available.
The first student in line gets promoted automatically when a confirmed student cancels, and the queue is renumbered without any gaps.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.