Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
UUIDは衝突の夢を見るか
Search
Dorian
April 26, 2017
Programming
1
1.2k
UUIDは衝突の夢を見るか
Dorian
April 26, 2017
Tweet
Share
More Decks by Dorian
See All by Dorian
VMとAWS ECSがメインのインフラにKubernetesを導入した効能
doridoridoriand
1
3.5k
オープンSNSフレームワークについて
doridoridoriand
0
1.1k
Other Decks in Programming
See All in Programming
Domain-centric? Why Hexagonal, Onion, and Clean Architecture Are Answers to the Wrong Question
olivergierke
2
870
What's new in Spring Modulith?
olivergierke
1
150
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
120
Server Side Kotlin Meetup vol.16: 内部動作を理解して ハイパフォーマンスなサーバサイド Kotlin アプリケーションを書こう
ternbusty
3
190
詳しくない分野でのVibe Codingで困ったことと学び/vibe-coding-in-unfamiliar-area
shibayu36
3
5k
「ちょっと古いから」って避けてた技術書、今だからこそ読もう
mottyzzz
11
6.7k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
380
XP, Testing and ninja testing ZOZ5
m_seki
3
670
CSC305 Lecture 04
javiergs
PRO
0
270
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
350
『毎日の移動』を支えるGoバックエンド内製開発
yutautsugi
2
250
登壇は dynamic! な営みである / speech is dynamic
da1chi
0
340
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Leading Effective Engineering Teams in the AI Era
addyosmani
5
430
YesSQL, Process and Tooling at Scale
rocio
173
14k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.7k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.2k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
Balancing Empowerment & Direction
lara
4
690
What's in a price? How to price your products and services
michaelherold
246
12k
RailsConf 2023
tenderlove
30
1.2k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
8
910
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
45
2.5k
Transcript
66*% িಥͷເΛݟΔ͔ 4LJMM8FEOFTEBZ
͓·͑ͩΕ w ͍ͩ͠ w --ͱ͔Α͘ॻ͘Α w ࠷͍ۙΜ;ΒΛ͔͍ͬͯ͡·͢ w ͓ञΛࢁҿΊΔਓΛਅʹ୳͍ͯ͠·͢
66*% w ϢχʔΫͳจࣈྻΛಘΔ࣌ྑ͍ͬͯ͘Δͱࢥ͍ ·͢ ҎԼྫ GEEDBCBEDE w ͲΜͳʹੜͯ͠িಥ͠ͳ͍ͱ͔ɻɻ w
ͰຊͳΜͰ͔͢Ͷ
ͦͦ66*%ͱ w ࢄγεςϜ্Ͱͱ౷ແ͠ʹ࡞Ͱ͖Δࣝผࢠͱ ͯ͠ઃܭ͞Εͨ w όʔδϣϯେผͯͭ͠ଘࡏ w ༷3'$ͱͯ͠ެ։͞Ε͍ͯΔ IUUQTUPPMTJFUGPSHQEGSGDQEG
w ࠷ॳͷࣈͷ෦͕όʔδϣϯΛද͍ͯ͠Δ w ࠷ޙͷจࣈͷ෦όϦΞϯτͱݺΕΔ มछͷछྨΛද͍ͯ͠Δ w όʔδϣϯ/*$ͷ."$ΞυϨεΛ༻ͨ͠Γ w όʔδϣϯόʔδϣϯͷҰ෦Λ104*9ͷ6*%(*%Ͱஔ͖ ͑ͨͷ
w όʔδϣϯͱ.%4)"Ͱੜͨ͠ϋογϡΛ༻͍ͯ ͍Δͷͱͳ͍ͬͯΔ GEEDBCBEDE
GEEDBCBEDE w զʑ͕ීஈ༻͍͍ͯΔ66*%όʔδϣϯ w ͦΕʹՃ͑ͯόϦΞϯτͱݺΕΔจࣈྻ͕ՃΘΔ " # ͷ͍ͣΕ͔ʹͳΔ
w શͯཚʹΑΔੜ
GEEDBCBEDE w ্ه66*%ਐͰܻCJU ਐ w ͔͜͜Βόʔδϣϯ ͱόϦΞϯτ
ΛҾ ͘ͱɺCJUͷࣗ༝͕͋Δ w ?º?௨Γ͘͢͝ଟ͍
ຊʹিಥ͠ͳ͍ͷʁ w ҙ֎ͱඦສͱ͔ग़ྗ͢ Δͱ͙͢িಥ͢ΔͷͰʁ w ͍͘Β EFWVSBOEPNͱ͔छʹ ͬͯͯͶ͑ɻɻ
·͋ͬͯΈͬ w 66*%Λͻͨ͢Βੜͯ͠%#ʹ*/4&35 w ͕࣌ؒڐ͢ݶΓͣͬͱ
require 'securerandom' require 'mysql2' client = Mysql2::Client.new(:host => 'localhost', :username
=> 'root', :password => 'password', :database => 'uuid' ) while true do begin uuid = SecureRandom.uuid client.query("insert into uuid.ruby (`uuid`) values ('#{uuid}')") puts uuid rescue => e p e end end
ॏෳνΣοΫ w ੜ͞Εͨ66*%શ݅Λ͖࣋ͬͯͯɺ ཁૉΧϯτ w VOJRϝιουΛར༻ͯ͠ॏෳഉআ ཁૉΧϯτ w ཁૉʹҧ͍͕͋Εॏෳ͍ͯ͠Δͣ ͘͢͝ಥ؏ͳॏෳνΣοΫ
ॏෳνΣοΫ ͘͢͝ಥ؏ͳॏෳνΣοΫ puts 'িಥͨ͠Ͱ' if data.count != data.uniq.count
ॏෳνΣοΫ దʹ#PUʹͭͿ͔ͤͯ֬ೝͱ͔ͯ͠·ͨ͠
ൃੜ w ༻ҙ͍ͯͨ͠%#ͷ༰ྔΛ͑Δ w ૉʹσΟεΫ͕େ͖͍%#Λ࡞Ҡߦ
ൃੜ w ԯ͑ͨ͋ͨΓ͔ΒॏෳνΣοΫͰ͖ͳ͘ͳΔ ͓͍ 1$ͷϝϞϦʹΒͳ͍ w ஞ࣍%#͔ΒಡΈऔͬͯಉҰͷ66*%͕͋Δ͔%#ʹ ͍߹Θͤ͢Δํࣜʹมߋ
ൃੜ w ,74ʹ͢ΕΑ͔ͬͨײ w ฒྻॲཧग़དྷΔΑ͏ʹ͚ͨ͠ΕͲΓ͍ ༻ҙͨ͠%#αʔόʔ͕ශऑͩͬͨ
Ͱɺিಥͨ͠ͷʁ w ੜͨ͠66*%ԯສ w ԯϨίʔυௐͨײͩ͡ͱিಥ͠·ͤΜͰͨ͠
Ͱɺিಥͨ͠ͷʁ w ଟ͠ͳ͍ͱࢥ͏ w 66*%ͩͱিಥ͠ͳ͍ͷ͔͚ͩΕͲɺ୯७ͳIFYͱ͔ Ͳ͏ͳΜͩΖ͏
͓͠·͍