Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
How to implement GUID With Python 
charsyam@naver.com
GUID?
Unique ID
When you need Unique ID?
User ID?
User ID? 
Service ID?
User ID? 
Service ID? 
Event ID?
Example
A Long Long Time Ago
Mac Address?
Device ID?
So, we need 
Unique ID!!!
UUID
Universally 
Unique ID
Universally 
Unique ID 
RFC 4122
550e8400-e20b-41d4-a716-446655440000
16 Octet (128bit)
SHA-1(MAC+Time)
BUT …
BUT … 
BUT …
BUT … 
BUT … 
BUT …
UUID is not good 
For Some Services
Why?
Too Big
Can’t order by 
Time
How to get these attributes!!
Research 
Just Google it.
MongoDB
Instagram
Twitter 
SnowFlake
MongoDB 
12 Bytes 
BSON Object
MongoDB
Instagram 
64 bits
Instagram
Instagram 
Logical Shard 
Physical Shard
Slowflake 
64 bits
Snowflake
Snowflake 
Zookeeper
Python-Guoid 
import guoid guid = guoid.SnowFlake(datacenter_id, worker_id) guid.next()
Python-Guoid 
https://github.com/charsyam/python-guoid
Python-Guoid 
Not service 
Just Library
Python-Guoid 
How to get 
Datacenter_id 
Worker_id
Thank you!
Upcoming SlideShare
Loading in …5
×

Guid python

1,273 views

Published on

Guid python

  1. 1. How to implement GUID With Python charsyam@naver.com
  2. 2. GUID?
  3. 3. Unique ID
  4. 4. When you need Unique ID?
  5. 5. User ID?
  6. 6. User ID? Service ID?
  7. 7. User ID? Service ID? Event ID?
  8. 8. Example
  9. 9. A Long Long Time Ago
  10. 10. Mac Address?
  11. 11. Device ID?
  12. 12. So, we need Unique ID!!!
  13. 13. UUID
  14. 14. Universally Unique ID
  15. 15. Universally Unique ID RFC 4122
  16. 16. 550e8400-e20b-41d4-a716-446655440000
  17. 17. 16 Octet (128bit)
  18. 18. SHA-1(MAC+Time)
  19. 19. BUT …
  20. 20. BUT … BUT …
  21. 21. BUT … BUT … BUT …
  22. 22. UUID is not good For Some Services
  23. 23. Why?
  24. 24. Too Big
  25. 25. Can’t order by Time
  26. 26. How to get these attributes!!
  27. 27. Research Just Google it.
  28. 28. MongoDB
  29. 29. Instagram
  30. 30. Twitter SnowFlake
  31. 31. MongoDB 12 Bytes BSON Object
  32. 32. MongoDB
  33. 33. Instagram 64 bits
  34. 34. Instagram
  35. 35. Instagram Logical Shard Physical Shard
  36. 36. Slowflake 64 bits
  37. 37. Snowflake
  38. 38. Snowflake Zookeeper
  39. 39. Python-Guoid import guoid guid = guoid.SnowFlake(datacenter_id, worker_id) guid.next()
  40. 40. Python-Guoid https://github.com/charsyam/python-guoid
  41. 41. Python-Guoid Not service Just Library
  42. 42. Python-Guoid How to get Datacenter_id Worker_id
  43. 43. Thank you!

×