Implement uid allocation in the MemoryStore