The question doesn't provide muchany detail on what you want to do with this. And this is very important, because the usage pattern is critical in determining which data structure is going to be most efficient for your use case.
But I'd say that in the absence of other details, a HashTable of Queues sounds like a sensible choice, with the HashTable using the ID as a key and the corresponding Queue as a value.
Then the following operations will both be O(1) with very low overhead:
- Add an item to the queue with a given ID
- Pull the first item from the Queue with a given ID
Which is presumablyprobably the usage pattern you are going to be needing in most cases.....