Concurrent Users & Unique Counter Increments on Database Store

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?

Because given the record creation processing time, theoretically two concurrent user could receive the same :max of the “Unique Number” field. My gut feel is that Bubble’s backend already handles this situation under the hood, just wanted to get a confirmation if anyone knows.

Thanks for your help!