Answer the question
In order to leave comments, you need to log in
How to store the number of issued IDs?
I define the user id in numerical sequence, i.e. 1,2,3, etc. I'm interested in how to store the value of the last issued id, in order to know what number to assign for a new id? I came up with an option with a table in the database that has a users_id_count column, and it stores the number of issued ids, and if you need to create a new id, then I just get the value of this field and plus 1. Is this option normal or are there more beautiful solutions?
Ps I need it to work with sharding
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question