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
エンジニアのための”最低限いい感じ”デザイン入門
shunshobon
0
130
Microsoft Orleans, Daprのアクターモデルを使い効率的に開発、デプロイを行うためのSekibanの試行錯誤 / Sekiban: Exploring Efficient Development and Deployment with Microsoft Orleans and Dapr Actor Models
tomohisa
0
210
コーディングエージェント時代のNeovim
key60228
1
110
🔨 小さなビルドシステムを作る
momeemt
2
550
オープンセミナー2025@広島LT技術ブログを続けるには
satoshi256kbyte
0
130
CSC305 Summer Lecture 12
javiergs
PRO
0
130
管你要 trace 什麼、bpftrace 用下去就對了 — COSCUP 2025
shunghsiyu
0
470
AI時代のドメイン駆動設計-DDD実践におけるAI活用のあり方 / ddd-in-ai-era
minodriven
23
9k
ライブ配信サービスの インフラのジレンマ -マルチクラウドに至ったワケ-
mirrativ
2
270
DockerからECSへ 〜 AWSの海に出る前に知っておきたいこと 〜
ota1022
5
1.8k
ワープロって実は計算機で
pepepper
2
1.4k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
190
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
42
2.8k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
We Have a Design System, Now What?
morganepeng
53
7.7k
Faster Mobile Websites
deanohume
309
31k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
A better future with KSS
kneath
239
17k
Mobile First: as difficult as doing things right
swwweet
223
9.9k
Become a Pro
speakerdeck
PRO
29
5.5k
Balancing Empowerment & Direction
lara
2
590
Optimizing for Happiness
mojombo
379
70k
Thoughts on Productivity
jonyablonski
69
4.8k
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