Unique user id generation ??

Hi -

I am required to generate unique custom ‘user ids’ for users registering on my app.

Initially I thought to create a pool of Ids in a table (as rows), and pull from it in ‘beforeRegister’ event - however, I am not able to find any API/mechanism to synchronize my operation on a table, so as 2 or more concurrent registrations do not try to use same id.

Can you please suggest any way around ??

Thanks.

You can use this to generate unique IDs:
https://backendless.com/documentation/utilities/rest/ut_caching_rest.htm

Did you really meant ‘caching’ ?? - or you wanted to mention ‘atomic counters’ ??

In case of counters, it may work, except that it will leave ‘holes/wasted ids’ in case the user registration doesn’t complete for some reason.

But I think I can live with some wasted ids for now :slight_smile:

Sorry, yes, I meant atomic counters…