Simultaneous Updates on the Shelf Records

Hi all,

I will create an experiment where tens of participants will join at the same time. This experiment will utilize Pavlovia’s shelf records as its database to inform experimentation in future time points (this is a longitidunal study). We will store participants’ performance, counterbalance conditions, and other important data in these shelves so that the design would work well across time.

My worry is that shelf records may be overwritten while “getting” and “setting” values because many participants will join and interact with this database at the same time. There is no real way of testing this potential problem before experimentation because that would cost a lot to do.

Could shelf records handle this traffic and NOT overwrite the database if:
• I “get” records from shelf,
• Change them at the end of each trial,
• Update the shelf database with “set” function?

Code version of this would be something like:

// trial ends
rt_array.push(trial_rt) // we add this trial's reaction time to a vector 
// for example: rt_array = [592, 869, 1233] this is the reaction time vector, we add new rt at the end of each trial

// then we want this reaction time array to be stored in the database for future studies
// for that, we get participants' information from database 
database = await psychoJS.shelf.getDictionaryFieldValue({key: ["study_database"], fieldName: "PARTICIPANTID HERE", defaultValue: "none"})

// change the database variable ONLY locally (e.g. not in shelf)
database["reactionTime"] = rt_array 

// change the database in shelf records
psychoJS.shelf.setDictionaryFieldValue({key: ["study_database"], fieldName: "PARTICIPANTID HERE", fieldValue : database })

The code above should execute quite fast, however, given that we interact with the database via internet we may get some delays.Is it “possible” that these delays can cause problems (overwriting, not receiving the final version of the database) when multiple participants update the database simultaneously? OR are there countermeasures embedded in the shelf system that orders these change requests and execute them one by one?

I would appreciate any support on this, thank you!