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

サーバーレスでAPIを提供する際のアプリケーション"以外"の話 / Talk about Se...

サーバーレスでAPIを提供する際のアプリケーション"以外"の話 / Talk about Serverless Other than Application

ServerlessDays Fukuoka 2019

Shimpei Takamatsu

December 14, 2019
Tweet

More Decks by Shimpei Takamatsu

Other Decks in Technology

Transcript

  1. Shimpei Takamatsu (@shimpeiws) WebΞϓϦέʔγϣϯΛத৺ʹ JavaScript / Ruby / React /

    Node.js …. ιϑτ΢ΣΞΤϯδχΞ at Tokyo Certified Scrum Master ΞδϟΠϧ։ൃ ΞʔϦʔεςʔδͷελʔτΞοϓΛத৺ʹɺ ΞʔΩςΫνϟ/ઃܭɾ࣮૷ͷαϙʔτ ٕज़ࢧԉ ౙ͸פ͍͠҉͍ɺαϘΓ͕ͪ δϣΪϯά 01 02 03 04 ࠓ೔͸ͪ͜Βͷ͓࿩Ͱ͢
  2. w Ϣʔβʔ͔ΒͷϦΫΤετΛड͚ϨεϙϯεΛฦ٫ w )551+40/ w ޙଓͷΞϧΰϦζϜϞδϡʔϧʹϦΫΤετ͠ɺ݁Ռ ΛΞάϦήʔγϣϯ w ೝূɾೝՄͳͲ "1*αʔϏϯά

    w ը૾ೝࣝɺػցֶशɾਂ૚ֶशɺΞόλʔੜ੒FUDʜ w ࢖༻ݴޠ͕ΞϧΰϦζϜʹΑͬͯҟͳΔ w ϫʔΫϩʔυ͕ΞϧΰϦζϜʹΑͬͯҟͳΔ w *0͕ΞϧΰϦζϜʹΑͬͯҟͳΔ w */࠾ੇσʔλɺը૾FUDʜ w 065σʔλɺը૾ɺ%ϑΝΠϧFUDʜ ΞϧΰϦζϜϞδϡʔϧ αʔϏεͷ֓ཁͱΞʔΩςΫνϟ 01 γεςϜߏ੒ͷಛ௃ w"1*αʔϏϯά෦෼ͱΞϧΰϦζϜϞδϡʔϧʹ෼͔ΕΔ wΞϧΰϦζϜ෦෼ͷԠ౴εϐʔυ͸ϞδϡʔϧʹΑ༷ͬͯʑ wΞϧΰϦζϜϞδϡʔϧ͸ݴޠϫʔΫϩʔυϨεϙϯελΠϜ*0͕༷ʑ
  3. αʔϏεͷ֓ཁͱΞʔΩςΫνϟ 01 Rails + PostgreSQL Elastic BeanstalkͰΦʔτεέʔϦϯά APIαʔόʔ Python, C++

    etc… EC2Πϯελϯε(CPU/GPU) ֤Ϟδϡʔϧ͕HTTPΠϯλϑΣʔεఏڙ Algorithm Modules HTTP/JSONͰ͢΂ͯಉظతʹ௨৴ ௨৴(API <> ΞϧΰϦζϜ) 01 02 03 Before
  4. αʔϏεͷ֓ཁͱΞʔΩςΫνϟ 01 Serverless + DynamoDB + Ұ෦postgres εέʔϦϯά͸Lambda APIαʔόʔ Python,

    C++ etc… EC2Πϯελϯε(CPU/GPU) ֤Ϟδϡʔϧ͸SQSΛϙʔϦϯά Algorithm Modules SQSΛத৺ͱͨ͠ΠϯλϑΣʔε Ұ෦S3΍DynamoDBͷτϦΨʔ ௨৴(API <> ΞϧΰϦζϜ) 01 02 03 After
  5. w 4FSWFSMFTT'SBNFXPSL /PEFKT 5ZQF4DSJQU  "84 w ୯७ͳ"1*ɺετϦʔϜ͔Βͷ-BNCEBىಈ w ϛυϧ΢ΣΞͷ࢖༻

    %ZOBNP%#ɺ"1*(BUFXBZ ͰͷXFCTPDLFUFUDʜ  w ϓϩμΫγϣϯͰ͸࢖༻͠ͳ͔ͬͨ΋ͷ΋͋Δ 1P$ w ϨΠϠϦϯάσΟϨΫτϦߏ੒ͷܾఆ w ڞ௨Ϟδϡʔϧͷ࡞੒ Ϩεϙϯε΍ΤϥʔϋϯυϦϯ ά  w Ϣχοτςετ KFTU ͷ؀ڥͱςετର৅ɾςετͷ ॻ͖ํͷύλʔϯΛ੔උ w -JOU ։ൃ؀ڥͷ੔උ αʔόʔϨε͸Ͳ͏ͩͬͨ? ։ൃલͷࣄલ४උ w։ൃऀ͸dਓఔ౓ɺػೳ։ൃɾςετͰϲ݄ఔ౓ͷظؒ wࣄલʹࣗ਎͕୲౰Ͱ࢓༷Λຬͨ͢͜ͱ͕Մೳ͔ͷ1P$ͱ։ൃ؀ڥͷ੔උΛ ͓͜ͳͬͨ 02
  6. w ։ൃͷ্ཱ͕ͪΓ͕ૣ͔ͬͨ w ΞϓϦέʔγϣϯΛॻ͘෼ʹ͸ֶशίετ͕௿͍ w جຊతʹ-BNCEBͷ'VODUJPOΛॻ͚ͩ͘ w ϢχοτςετͰ඼࣭͸҆ఆͨ͠ (PPE w

    $*΍ϦϦʔεϑϩʔ w MPDBM։ൃ؀ڥ w ωοτϫʔΫઃఆ w υϝΠϯɺ71$ɺ֎෦ωοτϫʔΫ઀ଓFUDʜ .PSF αʔόʔϨε͸Ͳ͏ͩͬͨ? (PPE.PSF w։ൃΛ௨ͯ͡ྑ͔ͬͨ෦෼ (PPE ͱ޻෉ͨ͠PS΋ͬͱվળ͍ͨ͠ .PSF ͳ෦෼ wΞϓϦέʔγϣϯ։ൃ͸૯ͯ͡εϜʔζͩͬͨ w.PSF͸ΞϓϦέʔγϣϯzҎ֎zͷ෦෼ 02
  7. w ։ൃͷ্ཱ͕ͪΓ͕ૣ͔ͬͨ w ΞϓϦέʔγϣϯΛॻ͘෼ʹ͸ֶशίετ͕௿͍ w جຊతʹ-BNCEBͷ'VODUJPOΛॻ͚ͩ͘ w ϢχοτςετͰ඼࣭͸҆ఆͨ͠ (PPE w

    $*΍ϦϦʔεϑϩʔ w MPDBM։ൃ؀ڥ w ωοτϫʔΫઃఆ w υϝΠϯɺ71$ɺ֎෦ωοτϫʔΫ઀ଓFUDʜ .PSF αʔόʔϨε͸Ͳ͏ͩͬͨ? (PPE.PSF w։ൃΛ௨ͯ͡ྑ͔ͬͨ෦෼ (PPE ͱ޻෉ͨ͠PS΋ͬͱվળ͍ͨ͠ .PSF ͳ෦෼ wΞϓϦέʔγϣϯ։ൃ͸૯ͯ͡εϜʔζͩͬͨ w.PSF͸ΞϓϦέʔγϣϯzҎ֎zͷ෦෼ 02
  8. w ։ൃͷ্ཱ͕ͪΓ͕ૣ͔ͬͨ w ΞϓϦέʔγϣϯΛॻ͘෼ʹ͸ֶशίετ͕௿͍ w جຊతʹ-BNCEBͷ'VODUJPOΛॻ͚ͩ͘ w ϢχοτςετͰ඼࣭͸҆ఆͨ͠ (PPE w

    $*΍ϦϦʔεϑϩʔ w MPDBM։ൃ؀ڥ w ωοτϫʔΫઃఆ w υϝΠϯɺ71$ɺ֎෦ωοτϫʔΫ઀ଓFUDʜ .PSF αʔόʔϨε͸Ͳ͏ͩͬͨ? (PPE.PSF w։ൃΛ௨ͯ͡ྑ͔ͬͨ෦෼ (PPE ͱ޻෉ͨ͠PS΋ͬͱվળ͍ͨ͠ .PSF ͳ෦෼ wΞϓϦέʔγϣϯ։ൃ͸૯ͯ͡εϜʔζͩͬͨ w.PSF͸ΞϓϦέʔγϣϯzҎ֎zͷ෦෼ 02
  9. αʔϏεͷ֓ཁͱΞʔΩςΫνϟ 01 Rails + PostgreSQL Elastic BeanstalkͰΦʔτεέʔϦϯά APIαʔόʔ Python, C++

    etc… EC2Πϯελϯε(CPU/GPU) ֤Ϟδϡʔϧ͕HTTPΠϯλϑΣʔεఏڙ Algorithm Modules HTTP/JSONͰ͢΂ͯಉظతʹ௨৴ ௨৴(API <> ΞϧΰϦζϜ) 01 02 03 Before
  10. αʔόʔϨεͱඇػೳཁ݅(ωοτϫʔΫͳͲ) 04 ͦͷଞͷখωλ w؀ڥ໊ͷTVGGJY͕ݪҼͰQSPEVDUJPO؀ڥߏஙͷλΠϛϯάͰ-BNCEBͷ จࣈ਺੍ݶΛ௒͑ͨ wϦϦʔεؒࡍʹͳΓɺQSPEVDUJPO؀ڥΛ४උͯ͠ʜ w"1*(BUFXBZɺ-BNCEB͸ͦΕͧΕʹϖΠϩʔυ্ݶΛ͍࣋ͬͯΔ w"1*(BUFXBZ .# ɺ-BNCEB

    .# ʜ wϛυϧ΢ΣΞΛଟ༻͢ΔͨΊ6OJU5FTU༻%PDLFSίϯςφͷϝϞϦফඅ͕ େ͖͘ɺ$JSDMF$*ͷඪ४ϝϞϦαΠζΛ௒͑ͨ wແ೦ͷҰ෦UFTUTLJQʜ w<13>ऴΘΒͳ͍-BNCEB࣮ߦͱ͍͏-BNCEBͰϋϚͬͨύλʔϯωλΛ ΞυϕϯτΧϨϯμʔͰॻ͖·͢