Python Forum

Full Version: creating a range of unique & sequential ID's in a database while handling concurency
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am in the planning phase of a project to create an app. I am wondering if anyone has any general strategy for what I outline below.

I have a need for an application that will create a range of unique and sequential numbers. The numbers have to be unique, and they have to sequential.

For instance if 6548 was the last ID created and a user requests 20 numbers, and the system would spit out something like: "Created numbers 6549 - 6568".

Of course there are more things in the model than just these numbers, but my big concern is how to handle multiple users requesting ranges of numbers at the same time and ensuring that they get a unique and sequential range of Id's.