Unique id generation in distributed systems