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
YAPC::Tokyo 2019 Log Friendly DB Design
Search
fisto
January 26, 2019
Programming
1
2.7k
YAPC::Tokyo 2019 Log Friendly DB Design
ログにやさしいDB設計
fisto
January 26, 2019
Tweet
Share
Other Decks in Programming
See All in Programming
Understanding Ruby Grammar Through Conflicts
yui_knk
1
130
開発チーム・開発組織の設計改善スキルの向上
masuda220
PRO
15
8k
Infer入門
riru
4
1.6k
State of CSS 2025
benjaminkott
1
120
学習を成果に繋げるための個人開発の考え方 〜 「学習のための個人開発」のすすめ / personal project for leaning
panda_program
1
110
フロントエンドのmonorepo化と責務分離のリアーキテクト
kajitack
2
140
管你要 trace 什麼、bpftrace 用下去就對了 — COSCUP 2025
shunghsiyu
0
470
CSC305 Summer Lecture 06
javiergs
PRO
0
100
Claude Codeで実装以外の開発フロー、どこまで自動化できるか?失敗と成功
ndadayo
2
1.4k
『リコリス・リコイル』に学ぶ!! 〜キャリア戦略における計画的偶発性理論と変わる勇気の重要性〜
wanko_it
1
600
物語を動かす行動"量" #エンジニアニメ
konifar
14
5.5k
Kiroの仕様駆動開発から見えてきたAIコーディングとの正しい付き合い方
clshinji
1
150
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.4k
Code Reviewing Like a Champion
maltzj
525
40k
Optimizing for Happiness
mojombo
379
70k
A better future with KSS
kneath
239
17k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
183
54k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
RailsConf 2023
tenderlove
30
1.2k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
How to train your dragon (web standard)
notwaldorf
96
6.2k
Six Lessons from altMBA
skipperchong
28
4k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
1k
Transcript
ϩάʹ͍͞͠%#ઃܭ @fist0 2019.01.26 YAPC::Tokyo 2019
2019.01.26 :"1$5PLZP 2 ࣗݾհ )/;͌͢ͱ +PCαʔόαΠυΤϯδχΞ *%pTUpTUP ͣͬͱHPMBOHॻ͍ͯͨ 4DBMBॻ͘ػӡ 4DBMBੜ
2019.01.26 :"1$5PLZP 3 ࢲͱ1FSM ͡Ίͯͷ:"1$͕:"1$"TJB5PLZP ৽ଔͰೖࣾͨ͠ͷ͕1FSMͷձࣾ ৽ଔݚमͰ1FSM ଐ͞Εͯ࠷ॳͷϓϩμΫτ1FSM
2019.01.26 :"1$5PLZP αʔϏεӡ༻ͯ͠·͔͢ʁ
2019.01.26 :"1$5PLZP ϩάݟͯ·͔͢ʁ
2019.01.26 :"1$5PLZP 6 ӡ༻ͱϩά ʁʁʁʮϩάʹαʔϏεͷେͳ͜ͱ͕ͯ͢٧·ͬͯΔΜͩΑʯ ʁʁʁʮͰɺ΄ͱΜͲͷਓͦΕʹؾ͔ͮͳ͍Μͩʜʯ ਆ༷ɺ༷ɺϩά༷
2019.01.26 :"1$5PLZP ใԸँಙ
2019.01.26 :"1$5PLZP ϩά
2019.01.26 :"1$5PLZP 9 ϩά ͍Ζ͍Ζ͋Δ ΞΫηεϩά )551αʔό FYOHJOY BQBDIF ͷϩά
ΞϓϦϩά 8FCΞϓϦέʔγϣϯ FY1FSM 1)1 3VCZ ͷϩά %#ϩά %# FY.Z42- 1PTUHSF42- ͷϩά
2019.01.26 :"1$5PLZP 10 ͳͥඞཁ͔ʁ αʔϏεʹԿ͕ى͖ͨͷ͔ΔͨΊ w σʔλੳ w ͍߹Θͤͷࣄ࣮֬ೝ w
োͷݪҼڀ໌ w োͷࣗಈݕ
2019.01.26 :"1$5PLZP 11 ϩάͷཁ݅ ߹ੑ ΞΫηεϩάʹϩά͕͋Δ͚ͲΞϓϦϩάʹϩά͕ͳ͍ͱ͔ ཏੑ 8FCΞϓϦͷಛघͳ݅ذͰΞϓϦϩά͕࿙Εͯͨͱ͔ ༰қੑ ΞΫηεϩάͱΞϓϦϩάΛඥ͚Δखஈ͕ͳ࣌͘Ͱඥ͚Δ͔͠ͳ͍ͱ͔
ௐࠪͷͨΊʹΞΫηεϩάΛߴසͰݟʹߦ͔ͳ͍ͱ͍͚ͳ͍ͱ͔
2019.01.26 :"1$5PLZP 'JO5FDI
2019.01.26 :"1$5PLZP 13 ͱ͋ΔԾ௨՟ΞϓϦͷ։ൃ Ϣʔβͷࢿ࢈αʔόͰཧ͢Δߏ %#ʹอଘ͞ΕΔσʔλͷ߹ੑ͕࠷༏ઌ αʔϏε͕ࢭ·ΔҎ্ʹσʔλͷෆ߹͕ා͍ Ճ͑ͯɺۚ༥γεςϜͱͯ͠ূΛٻΊΒΕΔ ϩάͱͯେࣄ
2019.01.26 :"1$5PLZP 14 ͱ͋ΔԾ௨՟ΞϓϦͷαʔόαΠυ αʔόαΠυ("&(PΛબ͕ͯͬͭ͠ΓΫϥυ 4UBDL%SJWFSΛ͑ϩάͷ߹ੑʹ͍ͭͯ͋·Γ৺ͳ͠ ৺ͳͷཏੑͱ༰қੑ
2019.01.26 :"1$5PLZP %#ઃܭ
2019.01.26 :"1$5PLZP 16 ߟ͑Δ͜ͱ ঢ়ଶΛ࣋ͬͨσʔλΛ%#ͰͲ͏ѻ͏͔ ঢ়ଶͷมԽΛϩάʹͲ͏ه͢Δ͔ ྫɿϢʔβͷຊԁߴɺຊਓ֬ೝεςʔλεɺϢʔβొใ
2019.01.26 :"1$5PLZP 17 ঢ়ଶͷมԽͱϩά Α͋͘ΔྫɿΞΧϯτͷͬऔΓʢෆਖ਼ϩάΠϯʴ*%1BTTมߋʣ ϢʔβใͷมߋཤྺΛௐࠪ͠ͳ͚ΕͳΒͳ͍ Ϣʔβใͷมߋ͕Ͳ͔͜ͷϩάʹ͍ͬͯͳ͚ΕͳΒͳ͍
2019.01.26 :"1$5PLZP 18 ։ൃݱͷ%#ઃܭ͍͖ͬͯ
2019.01.26 :"1$5PLZP 19 Ϣʔβͷຊԁߴ ຊԁߴશϢʔβ͕ਓͭ࣋ͭ ࠷৽ͷԁߴϢʔβʹදࣔ͢Δ ຊԁߴೖۚɺग़ۚɺԾ௨՟ചങ͕ൃੜ͢ΔͱมԽ͢Δ
2019.01.26 :"1$5PLZP 20 Ϣʔβͷຊԁߴͷઃܭᶃ VTFS JE 1, VTFSOBNF
VTFS@CBMBODF VTFS@JE 1, BNPVOU VQEBUFE@BU ϢʔβͷߴͷཤྺʢߴͷਪҠʣΛཧը໘ʹද͍ࣔͨ͠ͱ͖ ˠߴมߋʹؔΘΔΤϯυϙΠϯτͷΞΫηεϩάΛࢀর͢Δʁ
2019.01.26 :"1$5PLZP 21 Ϣʔβͷຊԁߴͷઃܭᶄ VTFS JE 1, VTFSOBNF
VTFS@CBMBODF JE 1, VTFS@JE BNPVOU DSFBUFE@BU ߋ৽࣌มԽޙͷ৽͍͠ߴΛ*/4&35ͯ͠ɺ࠷৽ͷߴΛऔΔͱ͖ SELECT ~ WHERE user_id = hoge ORDER BY created_at LIMIT 1
2019.01.26 :"1$5PLZP 22 Ϣʔβͷຊԁߴͷઃܭᶄ աڈͷߴͷϨίʔυ͕େྔʹͰ͖ͯύϑΥʔϚϯεݒ೦͕ͩ ཧը໘ʹඞཁͳσʔλอଘͰ͖͍ͯΔͷͰѱ͘ͳͦ͞͏ ଞ௨՟ͷߴVTFS@CBMBODFςʔϒϧͰཧ͢Δ͜ͱʹͳͬͨΒʁ
2019.01.26 :"1$5PLZP 23 Ϣʔβͷߴ ߴશϢʔβ͕௨՟ʹ͖ͭਓͭ࣋ͭ ௨՟ͷछผɺ+1:ɺ#5$ɺ&5)ͳͲ ࠷৽ͷ֤ߴϢʔβʹදࣔ͢Δ ߴೖۚɺग़ۚɺԾ௨՟ചങ͕ൃੜ͢ΔͱมԽ͢Δ
2019.01.26 :"1$5PLZP 24 Ϣʔβߴͷઃܭᶃ VTFS JE 1, VTFSOBNF
VTFS@CBMBODF VTFS@JE 1, KQZ@BNPVOU CUD@BNPVOU VQEBUFE@BU ߋ৽࣌৽͍͠ߴͰ61%"5& ௨՟ͷछผ͕૿͑Δͨͼʹ"-5&3จΛଧͭͷ͔ʁʢଧͪͨ͘ͳ͍'ʣ
2019.01.26 :"1$5PLZP 25 Ϣʔβߴͷઃܭᶄ VTFS JE 1, VTFSOBNF
VTFS@CBMBODF VTFS@JE 1, DVSSFODZ@JE BNPVOU VQEBUFE@BU ຊԁߴͷͱ͖ͱಉ༷ʹɺ ϢʔβͷߴͷཤྺʢߴͷਪҠʣΛཧը໘ʹද͍ࣔͨ͠
2019.01.26 :"1$5PLZP 26 Ϣʔβߴͷઃܭᶅ VTFS JE 1, VTFSOBNF
VTFS@CBMBODF JE 1, VTFS@JE DVSSFODZ@JE BNPVOU DSFBUFE@BU ߋ৽࣌มԽޙͷ৽͍͠ߴΛ*/4&35 ͰɺϢʔβͷ࠷৽ͷߴΛऔΔͱ͖ʜʁ
2019.01.26 :"1$5PLZP 27 Ϣʔβߴͷઃܭᶅ Ϣʔβͷ࠷৽ͷߴΛ௨՟ࢦఆͰऔಘ͍ͨ͠ͱ͖ SELECT ~ WHERE user_id =
hoge AND currency_id = jpy ORDER BY created_at LIMIT 1 Ϣʔβͷ࠷৽ͷߴΛશ௨՟छผͰऔಘ͍ͨ͠ͱ͖ ˠΫΤϦͰ͍͘ͳΒαϒΫΤϦࠈ ˠ্ͷΫΤϦΛ௨՟छผ͝ͱʹ࣮ߦ
2019.01.26 :"1$5PLZP 28 Ϣʔβߴͷઃܭᶆ VTFS JE 1, VTFSOBNF
VTFS@CBMBODF VTFS@JE 1, DVSSFODZ@JE 1, BNPVOU VQEBUFE@BU VTFS@CBMBODFʹ61%"5&ͷΫΤϦΛ࣮ߦ͢Δͱ͖ VTFS@CBMBODF@MPHʹ΄΅ಉͷϨίʔυΛ*/4&35͢Δ VTFS@CBMBODF@MPH JE 1, VTFS@JE DVSSFODZ@JE BNPVOU VQEBUFE@BU ෳ߹1,
2019.01.26 :"1$5PLZP 29 Ϣʔβߴͷઃܭᶆ Ϣʔβͷ࠷৽ͷߴΛ௨՟ࢦఆͰऔಘ͍ͨ͠ͱ͖ SELECT * FROM user_balance WHERE
user_id = hoge AND currency_id = jpy Ϣʔβͷ࠷৽ͷߴΛશ௨՟छผͰऔಘ͍ͨ͠ͱ͖ SELECT * FROM user_balance WHERE user_id = hoge ཧը໘ͰཤྺΛऔಘ͍ͨ͠ͱ͖ʢ௨՟ࢦఆʣ SELECT * FROM user_balance_log WHERE user_id = hoge AND currency_id = jpy
2019.01.26 :"1$5PLZP 30 ϩάςʔϒϧͷ αʔϏεͰར༻͢ΔςʔϒϧͱϩάςʔϒϧΛͨ͠ σʔλมߋͷཤྺΛ֬ೝ͢ΔͨΊʹΞΫηεϩάࢀরͭΒ͍ ΞΫηεϩάجຊͰ͔͍͠ݕࡧʹ͕͔͔࣌ؒΔ %#ϩάΛݟʹߦ͘ͷӡ༻తʹָͰͳ͍
2019.01.26 :"1$5PLZP 31 ϩάςʔϒϧͷಋೖํ ϨίʔυΛߋ৽͢ΔςʔϒϧҰϩάςʔϒϧΛ࡞Δํʹͨ͠ ঢ়ଶͷมԽΛؚΊσʔλͷมߋ͕શ෦ςʔϒϧʹΔ ˠશ෦Δɻཏੑͷ্ ˠςʔϒϧʹΔͷͰௐ͍ࠪ͢͠ɻ༰қੑͷ্
2019.01.26 :"1$5PLZP 32 ϩάςʔϒϧͷઃܭ
2019.01.26 :"1$5PLZP 33 ϝΠϯςʔϒϧͷΧϥϜ໊ʹॏෳ͠ͳ໋໊͍ IPHF JE 1, IPHF VQEBUFE@BU
IPHF@MPH MPH@JE 1, JE IPHF VQEBUFE@BU MPHHFE@BU ϩάςʔϒϧͷ໋໊نଇɺڞ௨ΧϥϜ໊౷ҰͰ͖ΔΑ͏ʹ
2019.01.26 :"1$5PLZP 34 ϨίʔυআͷରԠ IPHF JE 1, IPHF VQEBUFE@BU
IPHF@MPH MPH@JE 1, JE IPHF VQEBUFE@BU MPHHFE@BU IPHFͷϨίʔυΛআͨ͠ͱ͖IPHF@MPHʹͲΜͳϨίʔυ͕ೖΕΑ͍͔
2019.01.26 :"1$5PLZP 35 ϨίʔυআϑϥάͷՃ IPHF JE 1, IPHF VQEBUFE@BU
JT@EFMFUFE IPHF@MPH MPH@JE 1, JE IPHF VQEBUFE@BU MPHHFE@BU JT@EFMFUF@MPH ཧআఆ͕ͩɺສ͕ҰͷཧআʹରԠͰ͖ΔΑ͏ʹϑϥάΛ໋໊
2019.01.26 :"1$5PLZP 36 ϩάςʔϒϧͷ࠷ऴઃܭ IPHF JE 1, IPHF VQEBUFE@BU
IPHF@MPH MPH@JE 1, JE IPHF VQEBUFE@BU MPHHFE@BU JT@EFMFUF@MPH
2019.01.26 :"1$5PLZP 37 ࠷ऴઃܭͷײ ϝϦοτ Γ͍ͨ͜ͱʹରͯ͠ΫΤϦ͕ૉʹͳΔ มߋཤྺʹ͍ͭͯߟ͑ͳͯ͘Α͍ ཧআཧআͰ·ͳͯ͘Α͍ σϝϦοτ ࡞ߋ৽আܥΫΤϦͰ࣮ߦΫΤϦ͕Ұͭ૿͑ΔʢཁτϥϯβΫγϣϯʣ
ϩάςʔϒϧʹϨίʔυ͕ͲΜͲΜཷ·͍ͬͯ͘
2019.01.26 :"1$5PLZP 38 ϩάςʔϒϧංେԽ ϩάςʔϒϧʹϨίʔυ͕ͲΜͲΜཷ·͍ͬͯ͘ ˠ%#Λຊ൪༻ͱϩάςʔϒϧ༻Ͱ͚Δʁ ˠύʔςΟγϣχϯάͯ͠ఆظతʹຊ൪%#͔ΒऔΓग़͢ʁ
2019.01.26 :"1$5PLZP 39 ϩάςʔϒϧ༻ʹ%#ׂ͢Δ͔ʁ ӡ༻Λߟ͑ͨΒ%#ׂͨ͘͠ͳΔ ͔͠͠ϩάςʔϒϧʹτϥϯβΫγϣϯඞਢ ˠׂ͢ΔͱࢄτϥϯβΫγϣϯ͕ݦࡏԽ 4QBOOFSͷಉҰϓϩδΣΫτͰΠϯελϯε͚Δͷ͕Αͦ͞͏ʁ .Z42-ͳΒૉʹύʔςΟγϣχϯά͢Δͷ͕Αͦ͞͏
2019.01.26 :"1$5PLZP 40 %BUBTUPSFซ༻͍ͯ͘͠ελΠϧ ֎෦"1*͔ΒԾ௨՟Ձ֨Λऔಘͯ͠อଘ͢Δ औಘසۃΊ͍ͯ ʙඵʹճ ͷͰϨίʔυେ .Z42-ͳΒ%#ׂ͢ΔPS%BUBTUPSF͕Αͦ͞͏
2019.01.26 :"1$5PLZP 41 ࠓ͔͑ͨͬͨ͜ͱ
2019.01.26 :"1$5PLZP 42 ࠓ͔͑ͨͬͨ͜ͱ ϩάςʔϒϧΛ༻ҙ͢ΔઃܭͲ͏ʁ ϩάʹͯ͘͞͠ӡ༻ͷ؍͔ΒݟΔͱྑ͍ͱߟ͍͑ͯΔ ݱঢ়ɺ͜ΕҎ্ͷઃܭΛࢥ͍͔ͭͳ͔ͬͨ ͜ͷΛआΓͯઃܭϨϏϡʔ͕͍ͨ͠ Έͳ͞·ͷ͝ҙݟΛ͓͍ͪͯ͠·͢
2019.01.26 :"1$5PLZP 5IBOLT