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.1k
GKEを利用したサービスの運用
strsk8
1
570
パブリック/プライベートクラウドでつかうKubernetes
strsk8
1
2.3k
GKE@AbemaTV
strsk8
12
9.1k
re:Invent2015参加レポ
strsk8
0
270
成長し続けるインフラの安定運用事情
strsk8
19
5k
Other Decks in Technology
See All in Technology
[RSJ24] Object Retrieval in Large-Scale Indoor Environments Using Dense Text with a Multi-Modal Large Language Model
keio_smilab
PRO
0
230
技術力あげたい
hisaichi5518
2
2.9k
The XZ Backdoor Story
fr0gger
0
2.5k
標準ライブラリの奥深アップデートを掘り下げよう!
logica0419
2
430
四国のあのイベントの〇〇システムを45日間で構築した話 / cloudohenro2024_tachibana
biatunky
0
280
エンジニアリングマネージャーが紐解く、事業視点から組織文化まで、包括的アプローチの探求 / READYFOR
9ma3r
14
2.3k
AWS SAW を広めたい @四国クラウドお遍路
kazzpapa3
0
190
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
2
170
OCI コスト管理
ocise
1
150
Autonomous Database Cloud 技術詳細 / adb-s_technical_detail_jp
oracle4engineer
PRO
15
39k
Cloud Service Mesh への期待が止まらない!!
phaya72
2
160
React Aria で実現する次世代のアクセシビリティ
ryo_manba
4
920
Featured
See All Featured
Facilitating Awesome Meetings
lara
49
5.9k
Fashionably flexible responsive web design (full day workshop)
malarkey
401
65k
The Mythical Team-Month
searls
218
43k
Embracing the Ebb and Flow
colly
83
4.4k
The Brand Is Dead. Long Live the Brand.
mthomps
53
37k
A better future with KSS
kneath
235
17k
RailsConf 2023
tenderlove
27
800
Designing with Data
zakiwarfel
98
5k
Art, The Web, and Tiny UX
lynnandtonic
294
20k
Why Our Code Smells
bkeepers
PRO
334
56k
[RailsConf 2023] Rails as a piece of cake
palkan
45
4.6k
What's in a price? How to price your products and services
michaelherold
242
11k
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. ةػճආʂʂʂ