Use Redis to generate unique ID from a limited range
I have database items that, in addition to their primary key, need an index unique to the group in which the items belong. Let's call the property nbr , and the property that groups items together and defines the scope of unique nbr :s we'll call group . This nbr must be in the [1-N] range, and may be set when items are imported from an external source. Since all items must have a nbr , the task then becomes how to track which values are used, to enable picking a free nbr for new items that are added manually. I'm using DynamoDB and Redis. I cannot have a DynamoDB index on nbr . The idea I