Answer the question
In order to leave comments, you need to log in
How to generate an integer unique ID for a multi-user system?
How to generate an integer unique ID for a multi-user system?
Answer the question
In order to leave comments, you need to log in
Why didn't you like autoincrement IDENTITY (1,1)
? It is generated by means of the server itself and does not give duplicates during multi-user work. The value may not be consistent, but it will be unique for sure.
You can create a separate service for generating id, and your applications will access it. Something like twitter-snowflake.
For .net, there are libraries for generating keys, all that remains is to wrap them, for example, in a rest-service.
https://www.nuget.org/packages/IdGen/2.0.0-rc
https://www.nuget.org/packages/RustFlakes/
Use ranges for users (as is done with per-replica replication) or a prefix.
I don’t really understand the emphasis on SIMULTANEOUSNESS, why do you need to think about it, the database will think for you, then you need it ..
in extreme cases, you can make an api method that will pull the sequence in the database and return a unique identifier, so the client will know under what id should he save the card with
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question