Unique ID generation going wrong

Hello
We have a field in an order table that is acting as a unique id for the order. It is just a simple number that just adds up each time a new order is added to the table.
Although now since a couple of days it is generating random numbers.
We use last item of the table and add +1 to the number.

The development platform is working fine, it is only in production that the issue is popping up.


there so much going on, many user can be order same time so many edge cases.

to get straight incremental number, like 701, 702,703 … i had a same issue olce i was building a ordering system for a delivery app.

what. i did i used a backend workflow, and pass the current created order inside it also … then in backend i did a make change on it, and inside it, i did a search for all order and minus item the current order and then i use on count on list and plus one.

see if it work. you can also use your unix timestamp if its not important to be incremental but you want a unique integer. So it will be unique ea h time, as time stamps is like second , each second is passing by with time, so it will always be unique.

The simplest way to achieve sequential numbers is:

  1. Create a thing;
  2. Schedule a backend workflow in this thing;
  3. In the Backend Workflow, make a change to this thing, where thing’s number = Total things created before it + 1;

The only downside is that you cannot delete any entries from your database, otherwise that count will get lost and you will have repeated numbers.

incremental counting database objects in bubble is hard (see this)