I am using the Python standard uuid library. If my application eventually scales out to multiple servers, what should I be doing to ensure that the UUIDs don’t collide, since the different systems will be using different machine ids? Which of the UUID generators should I use?
I am using the Python standard uuid library. If my application eventually scales out
Share
uuid1()should be sufficient for your needs, since it takes the host ID into account.In section 4.2.2 of RFC 4122, this is the key bit:
The node field is the last 6 bytes of the UUID and will reflect one of the MAC addresses of the host in question.