Slide 1

Slide 1 text

"VSPSB͔3%4
 ͲͪΒΛબͿ΂͖͔ "84ࣄۀຊ෦ίϯαϧςΟϯά෦ ਺ࢬਖ਼थ

Slide 2

Slide 2 text

ࣗݾ঺հ ͔ͣ͑ • AWSࣄۀຊ෦ ίϯαϧςΟϯά෦ • େࡕΦϑΟεۈ຿ • 2019೥1݄JOIN • ৬ྺ • WEBίϯαϧʢडୗ։ൃʣ8೥ • ࣗࣾαʔϏε։ൃӡ༻อक 2೥ • ޷͖ͳAWSαʔϏε • Terraform

Slide 3

Slide 3 text

#cmdevio
 #Classmethod

Slide 4

Slide 4 text

͜ͷηογϣϯͷΰʔϧ AuroraͱRDSͷҧ͍Λཧղͯ͠ɺ
 ద੾ʹ࢖͍෼͚Δ͜ͱ͕Ͱ͖ΔΑ͏ʹͳΔ

Slide 5

Slide 5 text

΋͘͡ • RDSͱ͸ • Auroraͱ͸ • RDSͱAuroraͷҧ͍ • RDS͔AuroraͲͪΒΛબͿ΂͖͔ • ·ͱΊ

Slide 6

Slide 6 text

3%4ͱ͸ "NB[PO3FMBUJPOBM%BUBCBTF4FSWJDF w ϚωʔδυܕϦϨʔγϣφϧσʔλϕʔεαʔϏε w γϯϓϧ͔ͭਝ଎ʹεέʔϧ w ߴ଎ɺ҆ఆͨ͠ύϑΥʔϚϯε w ௿ίετɺैྔ՝ۚ w ϑΣʔϧΦʔόʔߏ੒Λ؆୯ʹ࣮ݱՄೳ

Slide 7

Slide 7 text

"VSPSBͱ͸ "NB[PO"VSPSB w Ϋϥ΢υ޲͚ʹ"84͕ߏஙͨ͠3%#αʔϏε w ίϚʔγϟϧσʔλϕʔεͷੑೳͱՄ༻ੑ w Φʔϓϯιʔεσʔλϕʔεͷγϯϓϧ͞ͱίετޮՌ w .Z42-ͱ1PTUHSF42-ͱͷޓ׵ੑ͋Γ w .Z42-ͷ࠷େഒɺ1PTUHSF42-ͷ࠷େഒߴ଎

Slide 8

Slide 8 text

ͦ΋ͦ΋ɺ͜ͷηογϣϯͷλΠτϧ͸͓͔͍͠ Aurora͸RDSͷҰ෦ ਖ਼֬ʹ͸
 "VSPSB͔
 "VSPSB͡Όͳ͍3%4
 ͲͪΒΛબͿ΂͖͔

Slide 9

Slide 9 text

RDSͱAuroraͷҧ͍

Slide 10

Slide 10 text

3%4ͱ"VSPSBͷҧ͍ w ΞʔΩςΫνϟͷҧ͍ w "VSPSBʹ͔͠ͳ͍ػೳ

Slide 11

Slide 11 text

ΞʔΩςΫνϟͷҧ͍

Slide 12

Slide 12 text

ΞʔΩςΫνϟͷҧ͍3%4 w IUUQTJNBHFTMJEFTIBSFDEODPNBXTCMBDLCFMUBVSPSBQPTUHSFTRMBXT CMBDLCFMUPOMJOFTFNJOBSBNB[POBVSPSBXJUIQPTUHSFTRMDPNQBUJCJMJUZKQH DC

Slide 13

Slide 13 text

ΞʔΩςΫνϟͷҧ͍"VSPSB w IUUQTJNBHFTMJEFTIBSFDEODPNBXTCMBDLCFMUBVSPSBQPTUHSFTRMBXT CMBDLCFMUPOMJOFTFNJOBSBNB[POBVSPSBXJUIQPTUHSFTRMDPNQBUJCJMJUZKQH DC w ";ܭՕॴͷετϨʔδʹ
 σʔλίϐʔ w ֤ετϨʔδؒͰ΍ΓͱΓ͠ ͯࣗಈम෮ w ՕॴฒྻʹΞΫηε w ॻ͖ࠐΈ͸ɺಡΈࠐΈ ͕੒ޭͨ͠Β"$,

Slide 14

Slide 14 text

Auroraʹ͔͠ͳ͍ػೳ

Slide 15

Slide 15 text

1SPUFDUJPO(SPVQT w IUUQTBXTBNB[PODPNKQCMPHTEBUBCBTFJOUSPEVDJOHUIFBVSPSBTUPSBHFFOHJOF

Slide 16

Slide 16 text

1SPUFDUJPO(SPVQT όοΫΞοϓ/ϦετΞ/ϦΧόϦʔ͕ૣ͍ w IUUQTJNBHFTMJEFTIBSFDEODPNBXTCMBDLCFMUBVSPSBQPTUHSFTRMBXT CMBDLCFMUPOMJOFTFNJOBSBNB[POBVSPSBXJUIQPTUHSFTRMDPNQBUJCJMJUZKQH DC

Slide 17

Slide 17 text

#BDL5SBDL Ϣʔεέʔε • Φϖϛε࣌ͷ෮چ • σʔλมߋλΠϛϯάͷௐࠪ σʔλΛר͖໭͢ w IUUQTJNBHFTMJEFTIBSFDEODPNBXTCMBDLCFMUBVSPSBNZTRMBXTCMBDLCFMU POMJOFTFNJOBSBNB[POBVSPSBNZTRMKQH DC

Slide 18

Slide 18 text

ΫϥελΩϟογϡ؅ཧʹΑΔߴ଎ϦΧόϦ ͜Ε·Ͱ:ϑΣΠϧΦʔόʔޙͷΩϟογϡͷճ෮ʹ͔͔࣌ؒΔ w IUUQTQBHFTBXTDMPVEDPNST5;.JNBHFT%QEG

Slide 19

Slide 19 text

ΫϥελΩϟογϡ؅ཧʹΑΔߴ଎ϦΧόϦ w IUUQTQBHFTBXTDMPVEDPNST5;.JNBHFT%QEG ϓϥΠϚϦঢ֨ͨ͠Πϯελϯε͕࠷ॳ͔ΒϗοτͳΩϟογϡอ࣋

Slide 20

Slide 20 text

ฒྻΫΤϦ w IUUQTQBHFTBXTDMPVEDPNST5;.JNBHFT%QEG • ΫΤϦ࣮ߦɺτϥϯβΫγϣϯͳͲ͸
 Πϯελϯεͷ໾ׂ • ετϨʔδଆʹ΋CPU͕ଘࡏ(਺ઍݸʣ • Ұ෦ΛɺετϨʔδଆϦιʔεͰߦͳ͏
 ˠ ॲཧߴ଎Խ • ΫΤϦ͕࠷େͰ120ഒߴ଎ʹͳͬͨ • 22ΫΤϦͷ͏ͪ8ΫΤϦͰ10ഒҎ্ߴ଎Խ ➡ ΠϯελϯελΠϓΛr3.8xlarge→r3.2xlarge
 ʹམͱͤͨ

Slide 21

Slide 21 text

(MPCBM%BUBCBTF ετϨʔδϨΠϠͰͷϦʔδϣϯؒϨϓϦέʔγϣϯ w IUUQTTQFBLFSEFDLDPNNBSPPOTUPTIPVRJOHOJSJ[JZPOKJBOESHBEFLJSVBVSPSBHMPCBMEBUBCBTFGBMTFTIJMJXPKJBO UFNJUB TMJEF ैདྷͷCross-Region Read Replica

Slide 22

Slide 22 text

(MPCBM%BUBCBTF ετϨʔδϨΠϠͰͷϦʔδϣϯؒϨϓϦέʔγϣϯ w IUUQTQBHFTBXTDMPVEDPNST5;.JNBHFT%QEG w IUUQTEFWDMBTTNFUIPEKQDMPVEBXTSFHSPXUIBVSPSBHMPCBMEBUBCBTF • 1ඵҎ಺ͷϨϓϦΧ஗Ԇ • 1෼Ҏ಺ͷ෮چ • ϨϓϦέʔγϣϯઌϦʔ δϣϯʹDBΠϯελϯε ݐͯͳͯ͘΋OK
 →௿Ձ֨ͰDRରԠՄ

Slide 23

Slide 23 text

"VSPSB4FSWFSMFTT w IUUQTQBHFTBXTDMPVEDPNST5;.JNBHFT%QEG • DBΠϯελϯεͷ؅ཧෆཁ:
 ෛՙʹԠͯࣗ͡ಈεέʔϧ • ࢖༻͍ͯ͠ͳ͍࣌ʹ͸γϟοτμ΢ ϯˠΠϯελϯεͷྉ͔͔ۚΒͳ͍ • Ϣʔεέʔεɿ։ൃ؀ڥ/धཁ͕ಡΊ ͳ͍ϫʔΫϩʔυ • REST API / SDK ͔Β΋ΞΫηεՄೳ ʹʢAurora Serverless Data APIʣ

Slide 24

Slide 24 text

"VSPSBʹ͔͠ͳ͍ػೳ • όοΫΞοϓ/ϦετΞ/ϦΧόϦʔ͕ૣ͍(Protection Groups) • BackTrack • ΫϥελΩϟογϡ؅ཧʹΑΔߴ଎ϦΧόϦ • ฒྻΫΤϦ • Global Database • Aurora Serverless • ΄͔ʹ΋৭ʑ৭ʑ ✴ DBΤϯδϯɺόʔδϣϯʹΑͬͯରԠঢ়گ͕·ͪ·ͪͳͷͰ஫ҙ

Slide 25

Slide 25 text

RDS͔AuroraͲͪΒΛબͿ΂͖͔

Slide 26

Slide 26 text

Slide 27

Slide 27 text

ͦͷલʹ

Slide 28

Slide 28 text

Slide 29

Slide 29 text

ϦϨʔγϣφϧσʔλϕʔε͕࠷ద͔ • RDBҎ֎ʹ΋༷ʑͳσʔλϕʔεαʔϏε͕͋Δ • ·ͣ͸RDBҎ֎΋ީิʹೖΕͯݕ౼͠Α͏ • SUMMITͷηογϣϯ͕͓͢͢Ί https://www.youtube.com/watch?v=h1r8AzOdlqo

Slide 30

Slide 30 text

Slide 31

Slide 31 text

"VSPSBΛ࢖͑ͳ͍έʔε • DBΤϯδϯ͕ҟͳΔ • όʔδϣϯ͕ҟͳΔ • ετϨʔδΤϯδϯ͕ҟͳΔʢMySQLͷ৔߹ʣ • ΠϯελϯελΠϓ͕ҟͳΔ

Slide 32

Slide 32 text

%#Τϯδϯ͕ҟͳΔ

Slide 33

Slide 33 text

όʔδϣϯ͕ҟͳΔ

Slide 34

Slide 34 text

ετϨʔδΤϯδϯ͕ҟͳΔʢ.Z42-ͷ৔߹ʣ • Aurora͕αϙʔτ͍ͯ͠Δͷ͸ InnoDBͷΈ • MyISAMͳͲଞͷετϨʔδΤϯδϯΛ࢖͍͍ͨ৔߹͸RDS • ͨͩ͠RDSͰ΋ਪ঑͸InnoDB

Slide 35

Slide 35 text

ΠϯελϯελΠϓ͕ҟͳΔ U NJDSP TNBMM NFEJVN MBSHF YMBSHF YMBSHF U NJDSP TNBMM NFEJVN MBSHF YMBSHF YMBSHF N NFEJVN MBSHF YMBSHF YMBSHF N MBSHF YMBSHF YMBSHF YMBSHF YMBSHF YMBSHF N MBSHF YMBSHF YMBSHF YMBSHF YMBSHF YMBSHF S MBSHF YMBSHF YMBSHF YMBSHF YMBSHF S MBSHF YMBSHF YMBSHF YMBSHF YMBSHF YMBSHF S MBSHF YMBSHF YMBSHF YMBSHF YMBSHF YMBSHF RDS for MySQL(5.6)

Slide 36

Slide 36 text

ΠϯελϯελΠϓ͕ҟͳΔ U NJDSP TNBMM NFEJVN MBSHF YMBSHF YMBSHF U NJDSP TNBMM NFEJVN MBSHF YMBSHF YMBSHF N NFEJVN MBSHF YMBSHF YMBSHF N MBSHF YMBSHF YMBSHF YMBSHF YMBSHF YMBSHF N MBSHF YMBSHF YMBSHF YMBSHF YMBSHF YMBSHF S MBSHF YMBSHF YMBSHF YMBSHF YMBSHF S MBSHF YMBSHF YMBSHF YMBSHF YMBSHF YMBSHF S MBSHF YMBSHF YMBSHF YMBSHF YMBSHF YMBSHF Aurora MySQL (5.6)

Slide 37

Slide 37 text

"VSPSBΛ࢖͑ͳ͍έʔεʢ࠶ܝʣ • DBΤϯδϯ͕ҟͳΔ • όʔδϣϯ͕ҟͳΔ • ετϨʔδΤϯδϯ͕ҟͳΔʢMySQLͷ৔߹ʣ • ΠϯελϯελΠϓ͕ҟͳΔ

Slide 38

Slide 38 text

Slide 39

Slide 39 text

ʢ͋·Γͳ͍(^_^;)ʣ

Slide 40

Slide 40 text

ʢ"VSPSBΑΓ΋ʣ3%4Λ࢖͏΂͖έʔε • DBΤϯδϯͷ৽ػೳΛ͍ͪૣ͘࢖͍͍ͨ • ద༻͞Εͳ͍ύϥϝʔλʔ͕ॏཁ • ͍҆ͨ͘͠

Slide 41

Slide 41 text

%#Τϯδϯͷ৽ػೳΛ͍ͪૣ͘࢖͍͍ͨ • RDSͷํ͕࠷৽ͷDBΤϯδϯόʔδϣϯରԠ͕ૣ͍ • ྫ1: PostgreSQL 10ରԠ • RDS: 2018/02/27 (10.1)
 2018/07/25 (10.4) • Aurora: 2018/09/25 (10.4 ޓ׵) • ྫ2: MySQL 5.7ରԠ • RDS: 2016/02/22 • Aurora: 2018/02/06
 w IUUQTEPDTBNB[POBXTDOFO@VT"NB[PO3%4MBUFTU"VSPSB6TFS(VJEF8IBUT/FXIUNM w IUUQTEPDTBXTBNB[PODPNKB@KQ"NB[PO3%4MBUFTU6TFS(VJEF8IBUT/FXIUNM

Slide 42

Slide 42 text

ద༻͞Εͳ͍ύϥϝʔλʔ͕ॏཁ AuroraͰ͸Ұ෦ͷMySQL/PostgreSQLͷύϥϝʔλʔ͕ແޮ w IUUQTEPDTBXTBNB[PODPNKB@KQ"NB[PO3%4MBUFTU"VSPSB6TFS(VJEF "VSPSB.Z42-3FGFSFODFIUNM"VSPSB.Z42-3FGFSFODF1BSBNFUFST*OBQQMJDBCMF w IUUQTEPDTBXTBNB[PODPNKB@KQ"NB[PO3%4MBUFTU"VSPSB6TFS(VJEF "VSPSB1PTUHSF42-3FGFSFODFIUNM"VSPSB1PTUHSF42-3FGFSFODF1BSBNFUFS(SPVQT

Slide 43

Slide 43 text

ద༻͞Εͳ͍ύϥϝʔλʔ͕ॏཁ AuroraͰ͸Ұ෦ͷMySQL/PostgreSQLͷύϥϝʔλʔ͕ແޮ • ྫ: MySQL innodb_change_buffering • σʔλߋ৽࣌ͷσΟεΫ΁ͷॻ͖ࠐΈΛ஗ΒͤΔػೳ
 มߋΛҰ࣌తʹϝϞϦʹΩϟογϡͯ͠ɺॻ͖ࠐΈॲཧΛߴ଎Խ ➡ ηΧϯμϦΠϯσοΫεΛେྔʹߋ৽͢ΔΑ͏ͳॲཧͷ৔߹ɺσΟεΫ্ ͷ༷ʑͳՕॴʹରͯ͠ॻ͖ࠐΈ͕ൃੜ͢Δˠ஗͍

Slide 44

Slide 44 text

͍҆ͨ͘͠՝ۚܗଶͷҧ͍ w IUUQTBXTBNB[PODPNKQSETNZTRMQSJDJOH w IUUQTBXTBNB[PODPNKQSETBVSPSBQSJDJOH RDS Aurora DBΠϯελϯε ࣌ؒैྔ՝ۚ ετϨʔδ ࣌ؒैྔ՝ۚ DBΠϯελϯε ࣌ؒैྔ՝ۚ ετϨʔδ ࣌ؒैྔ՝ۚ I/O ϦΫΤετ਺ैྔ՝ۚ ʴ ʴ ʴ > 100 ສ݅ͷϦΫΤετ͋ͨΓ
 0.24USD (@౦ژϦʔδϣϯ)

Slide 45

Slide 45 text

͍҆ͨ͘͠%#Πϯελϯεैྔ՝ۚ w IUUQTBXTBNB[PODPNKQSETNZTRMQSJDJOH w IUUQTBXTBNB[PODPNKQSETBVSPSBQSJDJOH RDS(USD/h) Aurora(USD/h) Ձ֨ࠩ r5.large 0.285 0.35 122.81% r5.xlarge 0.57 0.7 122.81% r5.2xlarge 1.14 1.4 122.81% r5.4xlarge 2.28 2.8 122.81% r5.12xlarge 6.84 8.4 122.81% ౦ژϦʔδϣϯɾMySQLɾγϯάϧAZɾr5ΠϯελϯελΠϓͰൺֱ

Slide 46

Slide 46 text

͍҆ͨ͘͠ ඞͣRDSͷํ͕҆͘ͳΔɺ
 ͱ͸ݴ͑ͳ͍

Slide 47

Slide 47 text

͍҆ͨ͘͠"VSPSBͷํ͕҆͘ͳΔ෦෼ Multi-AZʹ͠ͳͯ͘ྑ͍͔΋ • DBΠϯελϯε͕1AZͰ΋ɺετϨʔ δ͸3AZܭ6Օॴʹίϐʔ ➡ ͭ·Γ଱ٱੑ͸͋Δ • DBΠϯελϯε΋௨ৗ10෼ະຬͰճ෮ ➡ ͜ͷμ΢ϯλΠϜΛڐ༰Ͱ͖ ΔͳΒAurora Single-AZ=1Π ϯελϯεͰ΋ྑ͍ͷͰ͸

Slide 48

Slide 48 text

͍҆ͨ͘͠"VSPSBͷํ͕҆͘ͳΔ෦෼ Aurora͸StandbyϨϓϦΧෆཁ • ϦʔυϨϓϦΧΛϓϥΠϚϦʹࣗಈঢ֨Մೳ • RDS͸Ͱ͖ͳ͍ʢStandbyΛϦʔυϨϓϦΧͱͯ͠࢖͑ͳ͍) ➡ Multi-AZ͔ͭϦʔυϨϓϦΧߏ੒ͷ৔߹ɺ
 DBΠϯελϯεΛҰ୆ݮΒͤΔ

Slide 49

Slide 49 text

͍҆ͨ͘͠"VSPSBͷํ͕҆͘ͳΔ෦෼ ϨϓϦΧ෼ͷετϨʔδྉ͔͔ۚΒͳ͍ • RDS͸Πϯελϯε͝ͱʹετϨʔδΛ࣋ͭ • Aurora͸ετϨʔδΫϥελΛΠϯελϯε ؒͰڞ༗ ➡ ϨϓϦΧΠϯελϯεΛ૿΍ͨ͠ ࡍʹ௥ՃͰ՝ۚ͞ΕΔͷ͸ɺΠϯ ελϯε࣌ؒैྔ՝ۚͷΈ

Slide 50

Slide 50 text

͍҆ͨ͘͠"VSPSBͷํ͕҆͘ͳΔ෦෼ ϦʔυϨϓϦΧͷ୆਺ݮΒ͢orεϖοΫԼ͛ΒΕΔ͔΋ • RDS͸Πϯελϯε͝ͱʹε τϨʔδΛ࣋ͭ ➡ ॻ͖ࠐΈΫΤϦΛ֤Πϯ ελϯεͰ࣮ߦ͢Δඞཁ ͕͋Δ

Slide 51

Slide 51 text

͍҆ͨ͘͠"VSPSBͷํ͕҆͘ͳΔ෦෼ ϦʔυϨϓϦΧͷ୆਺ݮΒ͢orεϖοΫԼ͛ΒΕΔ͔΋ • Aurora͸ετϨʔδΫϥελΛΠϯελϯ εؒͰڞ༗ ➡ RR͸ॻ͖ࠐΈॲཧෆཁ
 ˠಡΈࠐΈॲཧ͚ͩʹઐ೦Ͱ͖ Δ
 →RDSͷ৔߹ͱಉ͡୆਺orε ϖοΫͷRRཁΒͳ͍͔΋ • Auto Scaling΋Ͱ͖·͢ʂ

Slide 52

Slide 52 text

͍҆ͨ͘͠"VSPSBͷํ͕҆͘ͳΔ෦෼ τʔλϧίετͰߟ͑Δ • Auroraʹ͸࡞ۀෛՙΛԼ͛ΒΕΔ෦෼͕ͨ͘͞Μ͋Δ • ΫΤϦνϡʔχϯά͠ͳͯ͘΋଎౓͕ग़Δʢग़΍͍͢ʣ • ϨϓϦΧ͙͢૿΍ͤΔɺAutoScalingͰ͖Δ • ॠ࣌ʹಛఆͷ࣌఺΁ר͖໭͢(Backtrack) • ͳͲͳͲ ➡ AWSར༻අ͸্͕ͬͯ΋ɺਓతίετΛ཈͑ΒΕΔͷͰ͸

Slide 53

Slide 53 text

ʢ"VSPSBΑΓ΋ʣ3%4Λ࢖͏΂͖έʔε ࠶ܝ • DBΤϯδϯͷ৽ػೳΛ͍ͪૣ͘࢖͍͍ͨ • ద༻͞Εͳ͍ύϥϝʔλʔ͕ॏཁ • ͍҆ͨ͘͠ • I/O Ͱ΋՝ۚ • Πϯελϯεྉ͕ۚߴ͍ • Auroraͷํ͕҆͘ͳΔ෦෼ • Multi-AZෆཁͳέʔε • StandByϨϓϦΧෆཁ • ϨϓϦΧ෼ͷετϨʔδྉ͔͔ۚΒͳ͍ • ϨϓϦΧͷ୆਺ݮΒ͢orεϖοΫԼ͛ΒΕΔ͔΋ • τʔλϧίετͰߟ͑Δ

Slide 54

Slide 54 text

·ͱΊ • AuroraͱRDSͷҧ͍Λཧղͯ͠ɺ
 ద੾ʹ࢖͍෼͚Δ͜ͱ͕Ͱ͖ΔΑ͏ʹ • ΞʔΩςΫνϟͷҧ͍ • Auroraʹ͔͠ͳ͍ػೳ • Aurora࢖͑ͳ͍৔߹ • RDS࢖͏΂͖৔߹ • Aurora͍͢͝ɻΈΜͳ΋·ͣAuroraࢼͦ͏ͥ • ͕͢͝͞఻Θͬͯͳ͔ͬͨΒࢲͷ੹೚Ͱ͢

Slide 55

Slide 55 text

͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠