I have a button that either adds ("PUT") or updates ("PATCH") a record to a database that I am connected to via an API.
I am looking for the ID of the record and if not found, adds the record to the database. I am finding that I am seeing two records being added and I believe it might be due to the end-user pushing this button a few times in a row and (I am guessing) that the database is not being updated with the new record fast enough to return the ID number, so a new record is being added twice (or sometimes three times).
Is this possible? Can a database return two different results a few seconds apart? Or should I be looking for another reason that two records are being added.