{"id":31961,"date":"2019-02-05T17:30:54","date_gmt":"2019-02-05T15:30:54","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/?p=31961"},"modified":"2019-02-05T17:31:00","modified_gmt":"2019-02-05T15:31:00","slug":"uuids-in-mysql-are-really-not-random","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2019\/02\/05\/uuids-in-mysql-are-really-not-random\/","title":{"rendered":"UUIDs in MySQL are really not random"},"content":{"rendered":"<!-- google_ad_section_start -->\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/blog.waleson.com\/2019\/02\/uuids-in-mysql-are-really-not-random.html\">Jouke Waleson<\/a> points out to an interesting fact about UUIDs in MySQL, which you might have missed in the <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/miscellaneous-functions.html#function_uuid\">documentation<\/a>:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Warning: Although UUID() values are intended to be unique, they are not necessarily unguessable or unpredictable. If unpredictability is required, UUID values should be generated some other way.<\/p><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Make a note!<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>Jouke Waleson points out to an interesting fact about UUIDs in MySQL, which you might have missed in the documentation: Warning: Although UUID() values are intended to be unique, they are not necessarily unguessable or unpredictable. If unpredictability is required, UUID values should be generated some other way. Make a note!<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"UUIDs in MySQL are really not random #WebDev #MySQL #databases #security","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,6,18,133,62,1334],"tags":[1559,3066,200,1330],"keyring_services":[],"class_list":["post-31961","post","type-post","status-publish","format-standard","hentry","category-general","category-linux","category-programming","category-sysadmin","category-technology","category-web-work","tag-databases","tag-mysql","tag-security","tag-web-development"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":28362,"url":"https:\/\/mamchenkov.net\/wordpress\/2018\/02\/04\/encrypt-mysql-data-using-aes-technique\/","url_meta":{"origin":31961,"position":0},"title":"Encrypt MySQL data using AES technique","author":"Leonid Mamchenkov","date":"February 4, 2018","format":false,"excerpt":"I came across this blog post from a while back, which demonstrates how to use AES encryption for the data in MySQL database. This seems rather easy and straightforward (apart from a little calculation one needs to do for the VARBINARY field types).\u00a0 The only thing that I'm concerned about\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":29180,"url":"https:\/\/mamchenkov.net\/wordpress\/2019\/01\/05\/ulid-universally-unique-lexicographically-sortable-identifier\/","url_meta":{"origin":31961,"position":1},"title":"ULID &#8211; Universally Unique Lexicographically Sortable Identifier","author":"Leonid Mamchenkov","date":"January 5, 2019","format":false,"excerpt":"If you thought that UUID was the end of universally unique identifiers, think again. Here's the ULID spec, with the following improvements: 128-bit compatibility with UUID1.21e+24 unique ULIDs per millisecondLexicographically sortable!Canonically encoded as a 26 character string, as opposed to the 36 character UUIDUses Crockford's base32 for better efficiency and\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":22487,"url":"https:\/\/mamchenkov.net\/wordpress\/2014\/09\/03\/making-mysql-better-at-github\/","url_meta":{"origin":31961,"position":2},"title":"Making MySQL Better at GitHub","author":"Leonid Mamchenkov","date":"September 3, 2014","format":"link","excerpt":"Making MySQL Better at GitHub \u00a0 \u00a0","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"mysql improvements at GitHub","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2014\/09\/mysql-improvements-at-GitHub-500x240.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":28186,"url":"https:\/\/mamchenkov.net\/wordpress\/2017\/11\/06\/mysql-vs-mariadb-reality-check\/","url_meta":{"origin":31961,"position":3},"title":"MySQL vs. MariaDB: Reality Check","author":"Leonid Mamchenkov","date":"November 6, 2017","format":false,"excerpt":"Percona Database Performance Blog runs this post -\u00a0MySQL vs. MariaDB: Reality Check - comparing the MySQL, MariaDB and the Percona Server for MySQL.\u00a0 I think that most people using MySQL or MariaDB today consider them to be pretty much identical (a fork for legal reasons or something along those lines).\u00a0\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":29062,"url":"https:\/\/mamchenkov.net\/wordpress\/2018\/12\/10\/mysql-high-availability-at-github\/","url_meta":{"origin":31961,"position":4},"title":"MySQL High Availability at GitHub","author":"Leonid Mamchenkov","date":"December 10, 2018","format":false,"excerpt":"Shlomi Noach, GitHub's Senior Infrastructure Engineer, shares some details on both the current and future high availability setup of MySQL databases at GitHub. This is probably way too far out for most people using MySQL for their web applications.\u00a0 But it does highlight the technical complexity of running high load\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/12\/mysql-ha-solution-at-github.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/12\/mysql-ha-solution-at-github.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/12\/mysql-ha-solution-at-github.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/12\/mysql-ha-solution-at-github.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/12\/mysql-ha-solution-at-github.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/12\/mysql-ha-solution-at-github.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":42747,"url":"https:\/\/mamchenkov.net\/wordpress\/2019\/06\/27\/calculating-distance-using-mysql\/","url_meta":{"origin":31961,"position":5},"title":"Calculating distance using MySQL","author":"Leonid Mamchenkov","date":"June 27, 2019","format":false,"excerpt":"\"Calculating distance using MySQL\" is a very useful blog post for everyone who works with geographical location data and MySQL. It shows a simple example of how to calculate the distance between two coordinates on a sphere (Earth in particular) within the MySQL itself. SELECT ST_Distance_Sphere( point(-87.6770458, 41.9631174), point(-73.9898293, 40.7628267)\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/06\/mysql-distance.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/06\/mysql-distance.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/06\/mysql-distance.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/06\/mysql-distance.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/06\/mysql-distance.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/06\/mysql-distance.png?resize=1400%2C800&ssl=1 4x"},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/31961","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=31961"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/31961\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=31961"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=31961"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=31961"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=31961"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}