Concurrent Users & Writing to an Increment "Unique Number" Field

Hello Everyone,

Hoping someone could perhaps advise on how Bubble handles the following :slight_smile:

  • Let’s say I have a “Unique Number” field for a Thing.
  • A workflow will create a new record, with “Unique Number” field increasing by 1 . This is done by finding :max of the “Unique Number” field, then + 1.
  • What happens when 100 users simultaneously triggers this workflow? Will Bubble’s backend be able to sequentially queue the records creation to guarantee “Unique Number” doesn’t duplicate?

Given the record creation processing time, theoretically, two concurrent user could receive the same :max of the “Unique Number” field, and as a result write two non-unique numbers to the “Unique Number” field. Does anyone know if Bubble’s backend already handles this concurrency situation?

Thanks for any input!

Hello @ask

The process will be done in parallel and therefore we cannot do an incremental count. The only thing that will be unique is the UNIQUE_ID. Subsequently, you use the COUNT to calculate the number of new registrations. Can’t use the count +1.

Also, you can create a SORT (text) field and enter a unique UNIX (time) value in it.

1 Like

That’s a great idea JohnMark! Thanks for that!

1 Like

Discussion

link: How to achieve unique sequential numbers

2 Likes

Super fantastic, this is exactly what I was hoping to find! Thanks again!

1 Like

Hello friends,

I’m so sorry for my late reply. I have a writing issue. I’m looking for a 3rd person help. For one of my website I need a content writer. Because I need to update my blog regularly. This time, I have been searching for someone who can work as a research paper helper. Where do you usually try if you need a reliable web content writer?

Thanks for your reply!