Scalaとサーバレス相性いいよ

 Scalaとサーバレス相性いいよ

LT @Scala Fukuoka 2017

C952d9f90c7ec6cb1b5513c05d3db536?s=128

yoshiyoshifujii

July 29, 2017
Tweet

Transcript

  1. 4DBMBͱαʔόϨε ૬ੑ͍͍Α  4BU !ZPTIJZPTIJGVKJJ

  2. ͸͡Ί·ͯ͠ w:PTIJUBLB'VKJJ !ZPTIJZPTIJGVKJJ w4PGUXBSF&OHJOFFS w4DBMB1ZUIPO+BWB 5ZQFTDSJQU w4DBMBؔ੢4VNNJU4UB⒎ w4FSWFSMFTT.FFUVQ0TBLB 4UB⒎

  3. None
  4. None
  5. None
  6. ձ৔εϙϯαʔ΍ͬͯ·͢ ʮ੢ͷ੟஍ʯ ͱݺ͹Εͯ·͢

  7. ି͠ग़͠Ͱ͖Δ෦԰ w ηϛφʔϗʔϧ ໊  w ձٞࣨ ໊͔Β໊  w

    ΧϑΣεϖʔε ໊  w ϏΞόογϡͳͲͷ࠙਌ձ΋։࠵ՄೳͰ͢ʂ
  8. ೥݄೔ ౔  !ఱຬݚमηϯλʔ

  9. ೥݄೔ ۚ ʙ !.05&9 IUUQTTFSWFSMFTTDPOOQBTTDPNFWFOU

  10. ೥݄೔ ۚ ʙ !͘͞ΒΠϯλʔωοτ෱ԬΦϑΟε IUUQTTFSWFSMFTTDPOOQBTTDPNFWFOU

  11. ຊ୊

  12. 4DBMBؔ੢4VNNJU $'1Λग़͠·ͨ͠

  13. ෼ 4FSWFSMFTTͱ%%%ͱ 4DBMB͸૬ੑ͍͍ͧ

  14. མબʜʌ Ň✱Ň ů

  15. ͳͷͰࠓ೔͸ ෼Ͱ࿩͠·͢

  16. 4DBMBͱαʔόϨε ͸૬ੑ͍͍Α

  17. 4FSWFSMFTT"SDIJUFDUVSFΛߏங͢Δͳ Βɺ%%%Λ4DBMBͰ࣮૷͢Δͱ͍͍Α

  18. 4FSWFSMFTTͱ %%%ͱ 4DBMB͸ ૬ੑ͍͍ͧ

  19. ઌʹ݁࿦ w%%%ͷϨΠϠʔԽΞʔΩςΫνϟʹج͍ͮͨϓϩδΣ Ϋτઃܭ wϕϯμʔϩοΫΠϯΛۃখԽ wςετ༰қͳ։ൃΛ࣮ݱ w4DBMBͱTCUͷϚϧνϓϩδΣΫτΛ׆༻͢Δͱɺͱͯ ΋૬ੑ͕͍͍

  20. ઌʹ݁࿦  w΋ͪΖΜશ෦͕શ෦߹͏Θ͚͡Όͳ͍ wҎԼͷέʔε͸ɺ1ZUIPOͳΓ/PEF+4͕ྑ͍ͱ ࢥ͍·͢ɻ wγϯϓϧͳ$36%ͷΈ w8FC"1*͕ݸ͙Β͍

  21. ࠓճͷείʔϓ w3&45GVMͳ8FC"1*γεςϜΛ૝ఆ wಉظɾඇಉظॲཧΛ࣮૷ wϏδωεϩδοΫ͕͋Δ wίΞυϝΠϯͰ͸ͳ͍

  22. 4FSWFSMFTT"SDIJUFDUVSFͷಛ௃ w'BB4 'VODUJPOBTB4FSWJDF Λ
 ׆༻ͨ͠γεςϜ wίετͷେ෯ͳ࡟ݮ wεέʔϥϏϦςΟ wΠϯϑϥͷӡ༻؅ཧ͕গͳ͍

  23. γεςϜߏ੒ਤ Amazon API Gateway client AWS Lambda Amazon S3 Amazon

    DynamoDB Amazon Kinesis AWS Lambda AWS Lambda Amazon Elasticsearch Service Context + Token Principal + Policy Policy is cached Denied 403 Allowed Auth function Consumers function
  24. None
  25. None
  26. None
  27. ͦͦ͜͜૿͑Δͱ͖͍ͭ w"1*ͷ਺͕Λ௒͑ͯ͘Δͱ͍Ζ͍Ζ͠ΜͲ͍ %FQMPZͷखؒ wॲཧͷڞ௨Խ wϞδϡʔϧΛখ͘͞อͭ

  28. %%%

  29. ϨΠϠʔԽΞʔΩςΫνϟ wϨΠϠʔͷ੹຿Λ໌֬ ʹ͢Δ͜ͱ wԼҐϨΠϠʔ͚ͩʹґ ଘ͢Δ͜ͱ wυϝΠϯΛִ཭͢Δ͜ ͱ &WBOT &SJD%PNBJO%SJWFO%FTJHO5BDLMJOH$PNQMFYJUZJOUIF)FBSUPG4PGUXBSF 

    ,JOEMFͷҐஔ/P 1FBSTPO&EVDBUJPO,JOEMF൛
  30. ࡾ૚ υϝΠϯϞσϧ wϓϨθϯςʔγϣϯ૚͔Βͷґ པΛड͚Δ wద੾ͳυϝΠϯΦϒδΣΫτʹ ൑அՃ޻ܭࢉΛґཔ͢Δ wϓϨθϯςʔγϣϯ૚ʹ݁Ռ υϝΠϯΦϒδΣΫτ Λฦ͢ wσʔλιʔε૚ʹه࿥΍݁Ռͷ

    ೖग़ྗΛࢦࣔ͢Δ ਤ૿ాږݱ৔Ͱ໾ཱͭγεςϜઃܭͷݪଇʙมߋΛָͰ҆શʹ͢ΔΦϒδΣΫτࢦ޲ͷ࣮ફٕ๏ ,JOEMFͷҐஔ/P גࣜձٕࣾज़ධ࿦ࣾ,JOEMF൛
  31. υϝΠϯΛத৺ʹߟ͑Δ wϨΠϠʔͷґଘϞσϧ w4FSWFSMFTT"SDIJUFDUVSF ͸ɺWFOEPSMPDLJOલఏͷΞ ʔΩςΫνϟ w%%%ͱ૊Έ߹Θͤͯ࡞Δ͜ͱ ͕Ͱ͖Ε͹ɺίΞͳϏδωε ϩδοΫ͕ϩοΫΠϯ͞Εͳ ͍ "QQMJDBUJPO

    *OGSBTUSVDUVSF %PNBJO "1* WFOEPSMPDLJO
  32. υϝΠϯΛத৺ʹߟ͑Δ wϨΠϠʔͷґଘϞσϧ w4FSWFSMFTT"SDIJUFDUVSF ͸ɺWFOEPSMPDLJOલఏͷΞ ʔΩςΫνϟ w%%%ͱ૊Έ߹Θͤͯ࡞Δ͜ͱ ͕Ͱ͖Ε͹ɺίΞͳϏδωε ϩδοΫ͕ϩοΫΠϯ͞Εͳ ͍ "QQMJDBUJPO

    *OGSBTUSVDUVSF %PNBJO "1* WFOEPSMPDLJO Amazon API Gateway AWS Lambda +"3ϑΝΠϧ +"3ϑΝΠϧ
  33. CVJMETCU lazy val domain = (project in file("./modules/domain")). lazy val

    infraDynamo = (project in file("./modules/infrastructure/dynamodb")). dependsOn(domain). lazy val infraKinesis = (project in file("./modules/infrastructure/kinesis")). dependsOn(domain). lazy val appHello = (project in file("./modules/application/hello")). dependsOn(infraLambda, infraDynamo, infraKinesis).
  34. (JUFS wIUUQTHJUIVCDPNZPTIJZPTIJGVKJJTCUBXT TFSWFSMFTTEEEH wͪ͜Βʹαϯϓϧίʔυ͕͋Γ·͢

  35. 4DBMB.BUTVSJ w4FSWFSMFTT "SDIJUFDUVSFΛ 4DBMBͰ΍ͬͯΈͨ࿩ Λ͠·ͨ͠

  36. None
  37. ೥݄೔ ۚ ʙ !.05&9 IUUQTTFSWFSMFTTDPOOQBTTDPNFWFOU