Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GAE_SE_Go_Second_generation_And_Cloud_Spanner.pdf

sonatard
December 04, 2018

 GAE_SE_Go_Second_generation_And_Cloud_Spanner.pdf

sonatard

December 04, 2018
Tweet

More Decks by sonatard

Other Decks in Programming

Transcript

  1. Server Side Engineer ͦͳͨ @sonatard 2006 - • Linux Server

    and Network Engineer 2010 - • Develop Wireless LAN Module Simulator with SystemC • Develop TCP/IP protocol stack on RTOS 2014 - • Go in my free time - Command-line utility for searching Github repository. https://github.com/sonatard/ghs - LDAP Auth Client library https://github.com/sonatard/go-ldapc 2017 - • Google App Engine Go Engineer
  2. 6 (PPHMF"QQ&OHJOF4UBOEBSE&EJUJPOͷۙ೥ͷಈ͖ w "QQ&OHJOF w (PPHMF࠷ॳͷΫϥ΢υαʔϏε w ($1Ҏલ͔Βଘࡏ w ݱࡏͰ͸"QQ&OHJOFҎ֎ʹ΋ଟ͘ͷ࣮ߦ؀ڥ͕ଘࡏ

    w ($& w "QQ&OHJOF'MFY&OWJSPONFOU w (,& w ,OBUJWF 4FSWFSMFTTBEEPOGPS(PPHMF,VCFSOFUFT&OHJOF  w $MPVE'VODUJPOT w ଞͷ࣮ߦ؀ڥ͔Β΋ར༻Ͱ͖ΔΑ͏ʹ"QQ&OHJOFґଘػೳΛ($1ʹ੾Γग़͢ಈ͖͕͋Δ w "QQ&OHJOF%BUBTUPSF$MPVE%BUBTUPSF w "QQ&OHJOFDSPO$MPVE4DIFEVMFS w "QQ&OHJOFUBTLRVFVF$MPVE5BTLT
  3. 7 (PPHMF"QQ&OHJOF4UBOEBSE&EJUJPOTUHFOͷ੍໿ͱฐ֐ w TUHFOͷ࣮ߦ؀ڥͱͯ͠ͷ੍໿ w ଞͷίϯςφͱΧʔωϧΛڞ༗͍ͯ͠Δ౎߹Ͱ৴པͰ͖ͳ͍γεςϜίʔϧΛ࣮ߦ͞ ΕΔڪΕ͕͋ΔͨΊɺ௚઀γεςϜίʔϧΛ࣮ߦ͢Δ͜ͱ͸Ͱ͖ͳ͔ͬͨ w 8FCΞϓϦέʔγϣϯΛఏڙ͢Δ্Ͱ࠷௿ݶඞཁͳγεςϜίʔϧ͸ɺBQQFOHJOF QBDLBHFΛར༻͠ͳ͚Ε͹͍͚ͳ͍

    w (PPHMFࣾ಺ͷ։ൃऀ w BQQFOHJOFQBDLBHFͷ։ൃ w (PͷόʔδϣϯΞοϓ͝ͱʹɺ(Pຊମʹ"QQ&OHJOFઐ༻ͷύονΛ౰ͯΔ w "QQ&OHJOFར༻ऀ w "QQ&OHJOFઐ༻ͷ(PͷίʔυΛॻ͔ͳ͚Ε͹͍͚ͳ͍ w ଞͷ࣮ߦ؀ڥ΁ͷҠ২ੑ͕௿͍ "QQ&OHJOF΁ͷϩοΫΠϯ͕ڧ͍ 
  4. 10 (PPHMF"QQ&OHJOF4UBOEBSE&EJUJPOOEHFO੍ݶղফʹΑΓՄೳʹͳͬͨ͜ͱ w TUHFOͰ͸ઈରʹͰ͖ͳ͔ͬͨ͜ͱ͕OEHFOͰ͸࠾༻Ͱ͖ΔΑ͏ʹ w ֎෦ͷίϚϯυΛμ΢ϯϩʔυ͓͍ͯͯ͠ɺͦͷόΠφϦΛ࣮ߦ͢Δ͜ͱ͕Մೳ w FYFD$PNNBOE w JOJU࣌ʹXHFUͰUNQμ΢ϯϩʔυUBSYWGͰίϚϯυΛ഑ஔ

    w ϦΫΤετ͝ͱʹͦͷίϚϯυΛ࣮ߦ w όΠφϦ͕)551ϦΫΤετΛ౤͛ΔΑ͏ͳ΋ͷ΋໰୊ͳ͍ DVSMIUUQTTBNQMFEPUQSPKFDUJEBQQTQPUDPNDNE HPMBOHHP5IF(PQSPHSBNNJOHMBOHVBHF GVODJOJU \  PVU FSSFYFD$PNNBOE XHFU lIUUQTBBBHITUBSH[z 0 UNQHITUBSH[ $PNCJOFE0VUQVU  PVU FSSFYFD$PNNBOE UBS YWG UNQHITUBSH[ $ lUNQ $PNCJOFE0VUQVU  ^ GVOD$NE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͜ͱ͕Ͱ͖ΔɻϩοΫ͸औΒͳ͍ɻ w ΫΤϦʔͷରԠঢ়گ w ରԠ w 4&-&$5ɺ*/4&35ɺ61%"5&ɺ%&-&5& w -*.*5ɺ0''4&5ɺ+0*/ɺ*/ɺ03ɺ)"7*/( w ະରԠ w -*,&
  8. 22 $MPVE42-ɺ$MPVE'JSFTUPSFɺ$MPVE4QBOOFS w $MPVE42- w εέʔϧΞ΢τ͠ͳ͍ w ϝϯςφϯεʹΑΔ࠶ىಈ͕(PPHMF౎߹Ͱ਺ϲ݄ʹ౓ൃੜ͢Δ w ։ൃ؀ڥ.Z42-ΛࣗલͰཱͯΔ

    w $MPVE'JSFTUPSF OBUJWFNPEF EBUBTUPSFNPEF  w Ϣʔβࢦఆ࣌ࠁͷόοΫΞοϓػೳ͕ͳ͍ w ॴఆ࣌ࠁ΁ͷϩʔϧόοΫ͕Ͱ͖ͳ͍ͱۚ༥Ͱ͸ར༻͕೉͍͠ w ։ൃ؀ڥΤϛϡϨʔλ͋Γ w $MPVE4QBOOFS w εέʔΞ΢ϧτ͢Δ w ϝϯςφϯεʹΑΔ࠶ىಈ͸ͳ͍ w Ϣʔβࢦఆ࣌ࠁͷόοΫΞοϓػೳ͕͋Δ w ϊʔυ՝ۚͷͨΊݸਓαʔϏεͰ͸ར༻ͮ͠Β͍ w ݄࠷௿ສɺϓϩμΫτͰ͸ϊʔυͷ৑௕ߏ੒Ͱສ w ։ൃ؀ڥΤϛϡϨʔλ͕ͳ͍ w
  9. 23 $MPVE4QBOOFSPO"QQ&OHJOF(P74$MPVE42-BOEEBUBTUPSF w $MPVE4QBOFOS74$MPVE42- w Ձ֨໘ͱ.Z42-ͷػೳΛϑϧʹ࢖͍͍ͨ৔߹Ҏ֎Ͱ$MPVE42-Λར༻͢Δཧ༝͸  w ػೳ͕ෆ଍͍ͯͯ͠΋ӡ༻ෆՄ͕Լ͕Δ΄͏Λબͼ͍͔ͨͲ͏͔࣍ୈ w

    $MPVE4QBOOFS74EBUBTUPSF w EBUBTUPSF͸,74ͳͷͰ.Z42-͔ΒͷҠߦ͸EBUBTUPSFͷํ͕େม w 4QBOOFS͸ଟগϊ΢ϋ΢͕ඞཁͳͷͰɺEBUBTUPSFͷํ͕ར༻͸༰қ w Ձ֨໘͸αʔϏεن໛࣍ୈ
  10. 25 .Z42-͔Β$MPVE4QBOOFS΁ͷҠߦ࣮ࡍʹࠔͬͨ͜ͱ w ରԠ͍ͯ͠Δܕ͕গͳ͍ w JOU͕ଘࡏ͠ͳ͍ w 1SPUPDPM#V⒎FSTͷFOVN͸JOUͳͷͰɺJOU΁ͷΩϟετ͕ඞཁ w ߏ଄ମ͸อଘͰ͖ͳ͍

    w %FDJNBMߏ଄ମΛอଘ͍͕ͨ͠खஈ͕ͳ͍ w ਺஋ΛTUSJOHʹ͢Δ͔ɺߏ଄ମͷཁૉΛ෼ղͯ͠ΧϥϜʹೖΕΔ͔͠ͳ͍ w */&5@/50"ͳͲ͕ͳ͍ w 4&-&$5*/&5@/50" JQ@BEESFTT '30.UBCMF͕࣮ߦͰ͖ͳ͍ w ఘΊͨ
  11. 26 .Z42-͔Β$MPVE4QBOOFS΁ͷҠߦΞʔΩςΫνϟ w σʔλϕʔεͷ౎߹͕ΞϓϦέʔγϣϯ૚υϝΠϯ૚ʹӨڹΛ༩͑ͳ͍Α͏࣮૷͢Δ w υϝΠϯͱ%#ͷςʔϒϧߏ଄Λผߏ଄ମͰఆٛ w ΞϓϦέʔγϣϯ૚͔Β͸3FQPTJUPSZΛܦ༝ͯ͠$36%Λ࣮ߦ͢Δɻ w υϝΠϯΛ౉ͯ͠ɺ%#ͷςʔϒϧͷߏ଄ମ΁ม׵

    QBDLBHFSFQPTJUPSZ UZQF6TFSJOUFSGBDF\  (FU#Z5ZQF DUYDPOUFYU$POUFYU UYEC3FBE5SBOTBDUJPO UQC5ZQF  EPNBJO6TFS FSSPS  ^ QBDLBHFEPNBJO UZQF6TFSTUSVDU\ *%TUSJOH 5ZQFQC5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