SACE Stage 2 Digital Technologies study materials
SACE Stage 2 Digital Technologies study resources

The Library After-Hours Login Surge

SACE Stage 2 Digital Technologies · Put your knowledge to work in context.

All case studies

The Library After-Hours Login Surge

A school library's booking system lets students reserve study rooms. Students log in with a student ID and a password. During exam week, the librarian reports that the system becomes very slow between 3:30 pm and 5:00 pm. The system currently checks every booking against every room to find a free slot, then checks the student's borrowing history before confirming. There are 1,200 students, 40 rooms, and about 600 bookings per afternoon. The librarian asks whether buying faster servers will fix the slowdown, or whether the problem lies elsewhere.

1. Explain whether the slowdown is most likely caused by the hardware or by the algorithm, and justify your reasoning.

Read the worked answer

The evidence points to the algorithm. The system compares every booking against every room, which is roughly 600 x 40 = 24,000 checks per afternoon, and then performs an unrelated borrowing-history lookup for each confirmation. Neither of these grows because the server is slow; they grow because of the amount of work the algorithm does. A faster server would reduce the time per check but would not reduce the number of checks, so the improvement would be temporary and expensive. The real fix is to index rooms by availability or to sort bookings by time, which reduces the number of comparisons dramatically. Buying hardware treats the symptom, not the cause.

2. The librarian proposes removing the borrowing-history check to speed things up. Evaluate this proposal using at least two competing considerations.

Read the worked answer

Removing the check would reduce work, but it changes the system's behaviour. First, the check may serve a policy purpose, such as preventing students with overdue items from booking rooms, so removing it changes who can use the service and may create an equity or fairness problem. Second, the check is a separate lookup, so it could be cached or run asynchronously rather than removed entirely, preserving the policy while cutting the delay. Third, removing it improves speed but may create a new problem, such as rooms being booked by students who cannot use them. The better judgement is to keep the policy but optimise how it is applied, rather than trading a policy goal for speed without the librarian's explicit agreement.

3. Describe one way the system could confirm a booking without checking every room against every booking.

Read the worked answer

The system could keep a list of free rooms for each time slot and remove a room from that list when it is booked. Then a new booking only needs to look at the free list for the requested slot, which is much shorter than comparing against all 40 rooms and all 600 bookings. This is a data-structure change: instead of searching, the system maintains an index. The trade-off is that the index must be updated whenever a booking is cancelled or changed, so the design must ensure the index stays consistent. This shows that the choice of data structure, not just the hardware, determines performance.