Distributed unique ID generation service
Options:
- Random
- Universally unique identifier (UUID)
- DB Auto-increment
- Ticket server
- Multi-ticket server
- Physical clock
- Unix Timestamp
- Twitter snowflake ID (Timestamp + workerID + sequenceNumber)
- Logical clock
- Lamport clocks
- Vector clocks
- TrueTime API
UUID
128-bit (16B) number. conflict概率极低:
After generating 1 billion UUIDs every second for approximately
100 years would the probability of creating a single duplicate reach 50%
Example: 09c93e62-50b4-468d-bf8a-c07e1040bfb2

Pros:
- Simple. Generating UUID is simple. No coordination between servers is needed so there will not
be any synchronization issues.
- Scalable. The system is easy to scale because each web server is responsible for generating IDs
they consume. ID generator can easily scale with web servers.
- Available.
Cons:
- IDs are 128 bits long, but our requirement is 64 bits.
- IDs could be non-numeric.