I am building a web application using a distrbuted NoSQL DB. However, for generating Ids for the new entities, I am using MySQL as Flickr's ticket server
I just stuck across an idea of keeping the stock of Ids at the application layer, so that newer entities may be easily allotted ids in a fast manner, without the need for fetching from DB, one by one, for each of them. Instead I can just pull a stock of Ids from the DB say around 1000, and use them uptil stack reaches a certain limit of remaining Ids, when I'll pull more of Ids from DB to fill the stack again.
Your ideas and thoughts upon this appreciated.