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.5k
GKEを利用したサービスの運用
strsk8
1
600
パブリック/プライベートクラウドでつかうKubernetes
strsk8
1
2.4k
GKE@AbemaTV
strsk8
12
9.2k
re:Invent2015参加レポ
strsk8
0
280
成長し続けるインフラの安定運用事情
strsk8
19
5.1k
Other Decks in Technology
See All in Technology
Copilotの力を実感!3ヶ月間の生成AI研修の試行錯誤&成功事例をご紹介。果たして得たものとは・・?
ktc_shiori
0
340
今から、 今だからこそ始める Terraform で Azure 管理 / Managing Azure with Terraform: The Perfect Time to Start
nnstt1
0
220
「隙間家具OSS」に至る道/Fujiwara Tech Conference 2025
fujiwara3
7
6.4k
0→1事業こそPMは営業すべし / pmconf #落選お披露目 / PM should do sales in zero to one
roki_n_
PRO
1
1.3k
Oracle Base Database Service:サービス概要のご紹介
oracle4engineer
PRO
1
16k
DMMブックスへのTipKit導入
ttyi2
1
110
Evolving Architecture
rainerhahnekamp
3
250
なぜfreeeはハブ・アンド・スポーク型の データメッシュアーキテクチャにチャレンジするのか?
shinichiro_joya
2
440
【NGK2025S】動物園(PINTO_model_zoo)に遊びに行こう
kazuhitotakahashi
0
220
.NET 最新アップデート ~ AI とクラウド時代のアプリモダナイゼーション
chack411
0
200
機械学習を「社会実装」するということ 2025年版 / Social Implementation of Machine Learning 2025 Version
moepy_stats
5
970
AWS re:Invent 2024 re:Cap Taipei (for Developer): New Launches that facilitate Developer Workflow and Continuous Innovation
dwchiang
0
160
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
Facilitating Awesome Meetings
lara
51
6.2k
Building an army of robots
kneath
302
45k
Being A Developer After 40
akosma
89
590k
A designer walks into a library…
pauljervisheath
205
24k
We Have a Design System, Now What?
morganepeng
51
7.3k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.4k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
A better future with KSS
kneath
238
17k
Rails Girls Zürich Keynote
gr2m
94
13k
Mobile First: as difficult as doing things right
swwweet
222
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. ةػճආʂʂʂ