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.4k
オープンSNSフレームワークについて
doridoridoriand
0
1.1k
Other Decks in Programming
See All in Programming
【re:Growth 2024】 Aurora DSQL をちゃんと話します!
maroon1st
0
830
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
350
競技プログラミングへのお誘い@阪大BOOSTセミナー
kotamanegi
0
370
良いユニットテストを書こう
mototakatsu
10
3.3k
fs2-io を試してたらバグを見つけて直した話
chencmd
0
260
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
550
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
160
テストケースの名前はどうつけるべきか?
orgachem
PRO
0
160
Оптимизируем производительность блока Казначейство
lamodatech
0
760
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
190
Effective Signals in Angular 19+: Rules and Helpers
manfredsteyer
PRO
0
170
103 Early Hints
sugi_0000
1
270
Featured
See All Featured
Producing Creativity
orderedlist
PRO
342
39k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
The World Runs on Bad Software
bkeepers
PRO
66
11k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Facilitating Awesome Meetings
lara
50
6.1k
Navigating Team Friction
lara
183
15k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Making Projects Easy
brettharned
116
6k
Code Reviewing Like a Champion
maltzj
521
39k
Measuring & Analyzing Core Web Vitals
bluesmoon
5
180
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ͱ͔ Ͳ͏ͳΜͩΖ͏
͓͠·͍