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
ソーシャルゲームDBの危機回避
Search
Ryosuke Suto
December 12, 2014
Technology
10
14k
ソーシャルゲームDBの 危機回避
MySQL Casual Talks vol.7
Ryosuke Suto
December 12, 2014
Tweet
Share
More Decks by Ryosuke Suto
See All by Ryosuke Suto
横断的なSRE推進と成熟度評価
strsk8
9
7.4k
GKEを利用したサービスの運用
strsk8
1
590
パブリック/プライベートクラウドでつかうKubernetes
strsk8
1
2.3k
GKE@AbemaTV
strsk8
12
9.2k
re:Invent2015参加レポ
strsk8
0
270
成長し続けるインフラの安定運用事情
strsk8
19
5.1k
Other Decks in Technology
See All in Technology
どちらを使う?GitHub or Azure DevOps Ver. 24H2
kkamegawa
0
760
統計データで2024年の クラウド・インフラ動向を眺める
ysknsid25
2
840
ゼロから創る横断SREチーム 挑戦と進化の軌跡
rvirus0817
2
270
Postman と API セキュリティ / Postman and API Security
yokawasa
0
200
re:Invent をおうちで楽しんでみた ~CloudWatch のオブザーバビリティ機能がスゴい!/ Enjoyed AWS re:Invent from Home and CloudWatch Observability Feature is Amazing!
yuj1osm
0
120
多領域インシデントマネジメントへの挑戦:ハードウェアとソフトウェアの融合が生む課題/Challenge to multidisciplinary incident management: Issues created by the fusion of hardware and software
bitkey
PRO
2
100
watsonx.ai Dojo #5 ファインチューニングとInstructLAB
oniak3ibm
PRO
0
160
AWS re:Invent 2024で発表された コードを書く開発者向け機能について
maruto
0
190
Amazon Kendra GenAI Index 登場でどう変わる? 評価から学ぶ最適なRAG構成
naoki_0531
0
110
C++26 エラー性動作
faithandbrave
2
730
2024年にチャレンジしたことを振り返るぞ
mitchan
0
140
alecthomas/kong はいいぞ / kamakura.go#7
fujiwara3
1
300
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
327
38k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.3k
GitHub's CSS Performance
jonrohan
1030
460k
Done Done
chrislema
181
16k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
520
Git: the NoSQL Database
bkeepers
PRO
427
64k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
2
170
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Transcript
CyberAgent, Inc. Ryosuke Suto ιʔγϟϧήʔϜ%#ͷ ةػճආ MySQL Casual
Talks vol.7 2014/12/07
$ZCFS"HFOU *OD ΞδΣϯμ ࣗݾհ σΟεΫ༰ྔͷةػΛճආ͢Δ ϨϓϦԆͷةػΛճආ͢Δ
ਢ౻ྋհʢ͢ͱ͏Γΐ͏͚͢ʣ @strsk גࣜձࣾαΠόʔΤʔδΣϯτ ΠϯϑϥˍίΞςΫຊ෦ ISUCON4 ༧બഊୀ $ZCFS"HFOU *OD
$ZCFS"HFOU *OD σΟεΫ༰ྔͷةػΛճආ͢Δ
$ZCFS"HFOU *OD
$ZCFS"HFOU *OD ΪϑτϘοΫεͱ ΧʔυҰཡͷ্ঢ͕Ϡό͍ • OͷσʔλͰ৽ँ͕ܹ͍͠ • ཤྺදࣔௐࠪͷͨΊɺҰఆظؒͷσʔλඞཁ •
ΠϕϯτͷϐʔΫ࣌े(#%BZ૿͑Δ͜ͱ • ཧআͨ͠··Ͱͯ͠ͳ͔ͬͨΓʜ
6 CyberAgent, Inc. Ϡό͍ʂʂʂ
$ZCFS"HFOU *OD ͬͨ͜ͱ • ཧআ͞Ε͍ͯΔɺҰఆظؒܦͬͨσʔλΛআ • আྔ͕ଟ͗͢ΔͷͰϝϯςϯε࣮ࢪ • */4&35*/504&-&$5ͱ3&/".&Ͱ࡞Γͳ
͓͢ • σʔλআόονΛͭͬͯ͘ఆظతʹআ
$ZCFS"HFOU *OD CREATE TABLE giftbox_new LIKE giftbox; INSERT INTO
giftbox_new SELECT giftbox WHERE (status = 1 AND updated > ‘2014-11-07 00:00:00’) OR (status = 0); RENAME giftbox giftbox_bk, giftbox_new giftbox; DROP TABLE giftbox_bk;
$ZCFS"HFOU *OD %&-&5&ͯ͠ ۭ͖༰ྔ͕૿͑ͳ͍ • IUUQOJQQPOEBOKJCMPHTQPUKQ JOOPECIUNM • %&-&5&ͯ͠আ͞ΕͨϚʔΫ͕͞ΕΔ͚ͩͰ༰
ྔݮΒͳ͍ • 015*.*;&͢ΔͨΊʹQUPTDΛ͔ͭ͏
$ZCFS"HFOU *OD $ pt-online-schema-change –-execute --alter=“engine=InnoDB” h=localhost,D=db_name,t=giftbox,u=root Α͔ͭ͘͏Φϓγϣϯ TFUWBSTlTRM@MPH@CJOzʜϨϓϦͤͨ͘͞ͳ͍࣌
DSJUJDBMMPBEʜεϨου͕͜ΕΛ͑Δͱதஅ NBYMPBEʜεϨου͕͜ΕΛ͑ΔͱҰ࣌ఀࢭ
$ZCFS"HFOU *OD ةػճආʂ
12 CyberAgent, Inc. ةػճආʂʂʂ
$ZCFS"HFOU *OD ϨϓϦԆͷةػΛճආ͢Δ
$ZCFS"HFOU *OD 536/$"5&ͨ͠ΒԆ • ήʔϜͷϚελσʔλ͕ຖճσʔλΛΫϦΞͯ͠ ಡΈࠐΉελΠϧ • ςʔϒϧΛ536/$"5&ͯ͠Δ෦ͰԆ͕ ൃੜ͍ͯ͠Δ
• %&-&5&͢ΔΑΓ͍
$ZCFS"HFOU *OD খ͍͞ςʔϒϧͰ͍ • ༰ྔ.#ɺ ߦ • 536/$"5&TFD •
%&-&5&TFD
16 CyberAgent, Inc. ͍ʂʂʂ
$ZCFS"HFOU *OD όάͩͬͨ • IUUQXXXQFSDPOBDPNCMPH QFSGPSNBODFQSPCMFNXJUIJOOPECBOEESPQ UBCMF • 536/$"5&は%301$3&"5&
• lJOOPEC@pMF@QFS@UBCMFzͰ%301࣌ͷόά • όοϑΝϓʔϧͷར༻ྔ͕େ͖͍΄Ͳ͘ͳΔ
$ZCFS"HFOU *OD %&-&5&ʹͯ͠Ԇճආ • σʔλྔ͕ଟ͍ͱ%&-&5&Ͱ͘ͳΔ • εϨʔϒˠϚελʔͷॱͰ࣮ߦͯ͠ճආ Slave> DELETE
FROM masterdata; Master> DELETE FROM masterdata; Master> INSET INTO masterdata (hoge,fuga,…) VALUES (xxx,yyy,…); ʢུʣ
19 CyberAgent, Inc. ةػճආʂʂʂ