Multiple writes to the same database field at the same time, is it possible?

Hi guys, I’m fairly new to coding, please forgive me if i’m asking silly question.

I am trying to use this code to update a number field (optB) in the database (ds). So everytime my students click the button (“voting” for a question), optB is increased by 1.

export function button_click(event) {
currentItem = ds.getCurrentItem();
let newNumber = currentItem.optB + 1
ds.setFieldValue( “optB” , newNumber)
ds.save()
}

It works fine when I’m testing alone on my laptop, but fail miserably when 50 students trying to click the button more or less the same time… It recognises just 7 of them. Is there any idea for a fix? Thanks a lot!