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
Scala: Mobile Backend on AWS
Search
arai-yusuke
February 20, 2016
Technology
1
650
Scala: Mobile Backend on AWS
arai-yusuke
February 20, 2016
Tweet
Share
More Decks by arai-yusuke
See All by arai-yusuke
Serverless Scala
cmaraiyusuke
0
1.8k
Play Scala on AWS, C10K and DevOps
cmaraiyusuke
2
1.3k
Other Decks in Technology
See All in Technology
標準最高!標準はださくないぞ! at fukuoka.ts #1
yoiwamoto
0
150
Oracle Database Backup Service:サービス概要のご紹介
oracle4engineer
PRO
0
4k
【Λ(らむだ)最近のアプデ情報 / RPALT20240904
lambda
0
160
Oracle Exadata Database Service(Dedicated Infrastructure):サービス概要のご紹介
oracle4engineer
PRO
0
9.3k
スーパーマリオRPGのリメイク版の変更点からみるUX
nishiharatsubasa
1
110
Practical GenAI with Go - Elastic and Golang Sydney
adriancole
0
130
手軽に始める? おうちサーバーのすゝめ
nyagasan
0
180
タイミーのBraze活用 ~PUSH通知を活用したレコメンド~
ozeshun
2
120
実践ジオフェンス 効率的に開発するために
navitimejapan
PRO
2
130
エンジニア視点で見る、 組織で運用されるデザインシステムにするには
shunya078
1
160
実践的なバグバウンティ入門
scgajge12
4
2.1k
データウェアハウス製品のSnowflakeでPythonが動くって知ってました?
foursue
1
150
Featured
See All Featured
Bash Introduction
62gerente
608
210k
Ruby is Unlike a Banana
tanoku
96
10k
YesSQL, Process and Tooling at Scale
rocio
167
14k
Designing Experiences People Love
moore
138
23k
Navigating Team Friction
lara
183
13k
Robots, Beer and Maslow
schacon
PRO
157
8.1k
Visualization
eitanlees
142
15k
What the flash - Photography Introduction
edds
67
11k
Automating Front-end Workflow
addyosmani
1365
200k
VelocityConf: Rendering Performance Case Studies
addyosmani
321
23k
Thoughts on Productivity
jonyablonski
65
4.2k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
24
2k
Transcript
%FWFMPQFST*0 # ߥҪ༞ี ⡥$MBTTNFUIPE *OD ݄ 4DBMB .PCJMF#BDLFOEPO"84
#cmdevio2016 #B
whoami • Yusuke Arai • Classmethod (2014/11~) • Mobile Backend
API Team (2015/02~) • AWS / Scala / Javascript / android • dev.classmethod.jp/author/arai-yusuke
Today's topics • Scalaͷoverview • ScalaΛͬͨϞόΠϧόοΫΤϯυAPI • ͳͥAWSωΠςΟϒͷ࣌ʹScala͕ඞཁ͔ • How
to આಘ your client in "Scala͍·͢!"
Today's topics • Scalaͷoverview • ScalaΛͬͨϞόΠϧόοΫΤϯυAPI • ͳͥAWSωΠςΟϒͷ࣌ʹScala͕ඞཁ͔ • How
to આಘ your client in "Scala͍·͢!"
Scalaͷoverview
Martin Odersky Deutscher Informatiker / 1958~
Scala • JVMݴޠʢJavaόΠτίʔυΛੜʣ • JavaͷطଘίʔυΛࢀরՄೳ • ڧ͍੩తܕ͚ݴޠ • ໊લ"Scalable"͔Β
Scala ͷจ๏ • ηϛίϩϯͷͳ͍JavaͬΆ͘ॻ͚Δ • RubyͬΆ͘ॻ͚Δ • هड़ྔ͕গͳ͍ • ৄ͘͠άά͍ͬͯͩ͘͞m(_
_)m
Scala ͷιɾϗϯτ
Αࣖ͘ʹ͢Δ • ؔܕͷϓϩάϥϛϯάݴޠ • Rubyʹ͍ۙͷͰLLܦݧऀͳΒָউ • Java͕Θ͔Ε͙͢ʹॻ͚ΔΑ͏ʹͳΔ • ΤίγεςϜʢPlayʣRailsϥΠΫ
શ෦ιͰ͢ • ؔܕͷϓϩάϥϛϯάݴޠ • Rubyʹ͍ۙͷͰLLܦݧऀͳΒָউ • Java͕Θ͔Ε͙͢ʹॻ͚ΔΑ͏ʹͳΔ • ΤίγεςϜʢPlayʣRailsϥΠΫ
Scala ͷϗϯτ
Scalaͷϗϯτ • ચ࿅͞ΕͨOOPݴޠ ͨͩ͠HaskellͷӨڹΛڧ͘ड͚͓ͯΓɺؔܕͷ ॻ͖ํͰॻ͘͜ͱՄೳʹͳ͍ͬͯΔ • JVMJavaݴޠͷཧղ͕ඞཁ • ΤίγεςϜʢPlayʣڧྗͳܕγεςϜΛแ͠ FP,
FRPΛલఏͱ͍ͯ͠Δ
Not ؔܕݴޠ • ݁ߏ͋Δצҧ͍ʮScalaؔܕݴޠDA!ʯ • Scalaࣗମચ࿅͞ΕͨOOPݴޠ • ͨͩ͠७ਮؔϕʔεͷ։ൃΛڧ͘αϙʔτͯ͠Δ • Haskellͱಉ͡ॻ͖ํΛ͠Α͏ͱࢥ͑Մೳ
ओͳཧ༝ͱͯ͠Scala͕ΞυϗοΫଟ૬ੑΛදݱͰ͖ Δ͔Β
Java/JVMͷཧղ͕ඞཁ • JVM͕ܕফڈϞσϧͰ͋Δ͜ͱʢॏཁʣ • GenericsJava 1.5ͰՃ͞Εͨ͜ͱ, ClassManifestͷڍಈ, etc… • Javaͷจ๏ͳͲΑΓɺJavaͷྺ࢙ʹର͢Δ
ཧղ͕ඞཁ
☓ LLऀͳΒೃછΈ͍͢ • ScalaaltJavaͱͯ͠ར༻Ͱ͖Δ͕ ͦΕ"Scalaݴޠ"ʹݶͬͨͰɺΤίγεςϜ͕ͦΕΛ ڐ͢ͱݶΒͳ͍ • Play Framework 2.4
ڧྗͳܕγεςϜΛ෦ʹ࣋ͪɺ ਵॴͰܕγεςϜͷཧղΛཁٻ͢Δɻ • ྫ: JsResult Applicative Functor Writes Contravariant Functor
ࢹΛม͑Δ
Scala Λ͍͚ͬͯ…… • JVMJavaͷྺ࢙ʹ͍ͭͯਂ͘ཧղͰ͖Δ • ؔܕͷάουϓϥΫςΟε͕औΓࠐΊΔ • ܕΫϥεɺతσʔλܕɺؔखɺϞφυ ͳͲͷమ൘ύλʔϯ͕͑ΔΑ͏ʹͳΔ •
৽͠ΊͷݴޠͰ͍͍ͩͨˢ͕Ұ෦·ͨશ෦͑Δ ྫ͑SwiftʹflatMapϝιου͕༻ҙ͞Ε͍ͯ·͢ • ৽͍͠ػೳΛ͍͜ͳ࣭͠ͷߴ͍ΞϓϦΛ࡞Δ͜ͱ͕Մೳʹʂ
Scalaͷoverview ͜Μͳײ͡Ͱ͢
Today's topics • Scalaͷoverview • ScalaΛͬͨϞόΠϧόοΫΤϯυAPI • ͳͥAWSωΠςΟϒͷ࣌ʹScala͕ඞཁ͔ • How
to આಘ your client in "Scala͍·͢!"
ScalaΛͬͨ ϞόΠϧόοΫΤϯυAPI
ϞόΠϧAPIαʔόʔΛ࡞ͬͨ • डୗϞόΠϧΞϓϦҊ݅ • ϦϦʔεޙC100K͕΄΅ؒҧ͍ͳ͍ • ҆ఆͯ͠ࡹͨ͘ΊʹϑϩϯτAPIαʔόʔʹ Play-ScalaΛ࠾༻ • όοΫΤϯυAkkaΛ͍͍ͨͱ͍͏ཧ༝͔Β
Play-Scalaʹͨ͠
None
։ൃͷਐΊํ • ϑϧͰςετॻ͘ ʢશΫϥεϢχοτςετɺAPIຖ࠷̍݁߹ςετʣ • pull reqϨϏϡʔඞਢ • ScalazCatsΘͳ͍ •
ࠓϦϦʔεલͳͷͰύϑΥʔϚϯεɾӡ༻ʹ͍ͭͯͷ͜ͱԿͱ ݴ͑ͳ͍ʢϦϦʔεͰ͖͍ͯͨΒӡ༻ϊϋΛ͓͔͑ͨͬͨ͠Ͱ͢……ʣ
։ൃͰײͨ͜͡ͱ
͑͛ͭͳ͍΄Ͳॻ͖͍͢ • ϘΠϥʔϓϨʔτίʔυͷগͳ͞ʹҺͼٽ͘ • ݴޠͦͷͷ͕ImmutableΛਪͯ͘͠ΕͯΔ ͜ͱͷ༗ΓΈΛࢥ͍Δ • ผʹΧοίΑ͘ॻ͜͏ͱͯ͠ͳ͍ͷʹؔ ͍͍ͩͨ5ߦҎʹ·ͱ·Δ
ΊͬͪΌಡΈ͍͢ • ʮScalaه߸͔ͬͰಡΈʹ͍͘ʯͬͯ ͱ͓͍ੲʹฉ͍ͨ͜ͱ͕͋ͬͨ • ͦΕHaskellͬΆ͘ॻ͍ͨ߹ͷͩͬͨ • γϯϓϧʹॻ͍͍ͯ͘ͱӳޠͬΆ͍จ຺Λ࣋ͭ • pull
reqϨϏϡʔ͕ḿΔ
ͳΜͱͳ͘ӳޠͬΆ͍ͷͰ͢
Akka • ࠓճϫʔΧʔΛAkka SchedulerͰ࣮ • AkkaͷFault ToleranceΛങͬͨ • Amazon SQSAmazon
SNSͱ͏·݁͘߹͢Δ • DynamoDB StreamKinesisͱ͚ͬͭͨ͘Β ઈରָ͍͠ͰΑ͢Ͷ
AWS Java SDK͕͑Δ • AWSͷϑϧϚωʔδυαʔϏεʢCognitoDynamoDBʣ ͱΓऔΓ͢ΔΞϓϦΛ࡞Δ߹ɺ AWS SDKͷυΩϡϝϯςʔγϣϯ۩߹ࢮ׆ • AWS
Java SDKʹԿͷ৺ͳ͔ͬͨ • Scalaͷݴޠࢥͱͯ͠ʮmutable࣮ΛimmutableͳΠϯ λϑΣʔεͰӅṭʯͱ͍͏ͷ͕͋Δ ˠ AWS Java SDK ΠϯϑϥͰӅṭͰ͖ΔͷͰແ
ΞʔΩςΫνϟͷརʢ1ʣ • ७ਮؔܕݴޠͩͱmainؔͷ֎ଆɺͭ·ΓࣗͰίϯτ ϩʔϧͰ͖ͳ͍ྖҬ·Ͱ෭࡞༻ΛԆ͠ͳ͚ΕͳΒͳ͍ ʢ͜ͱ͕ଟ͍ʣ • ScalaͰ෭࡞༻Λى͜͢λΠϛϯάΛࣗͰ ίϯτϩʔϧͯ͠OK ※ HaskellʹunsafePerformIOͱ͔͋Γ·͕͢……
• ຊʹԆ͖͢෭࡞༻ʢυϝΠϯϩδοΫ͕ى͜͢෭࡞༻ʣ ͱͦΕҎ֎ʢϩάͱ͔ʣΛผͷͷͱͯ͠ѻ͏͜ͱ͕༰қ ιϑτΣΞ
ΞʔΩςΫνϟͷརʢ2ʣ • ݴޠϨϕϧͰDIΛڧ͘αϙʔτ͢ΔͷͰ DIPୡͷલఏ͕͋ΔΞʔΩςΫνϟͱೃછΉ • Layered Architecture, Onion Architecture… •
DDDͳͲͰΑ͘࠾༻͞ΕΔΞʔΩςΫνϟ ιϑτΣΞ
ଓ͖·ͨޙͰ ࣌ؒʹ༨༟͕͋Ε
Today's topics • Scalaͷoverview • ScalaΛͬͨϞόΠϧόοΫΤϯυAPI • ͳͥAWSωΠςΟϒͷ࣌ʹScala͕ඞཁ͔ • How
to આಘ your client in "Scala͍·͢!"
ͳͥAWSωΠςΟϒ࣌ʹ Scala͕ඞཁ͔
ϚΠΫϩαʔϏε ΞʔΩςΫνϟ
ϚΠΫϩαʔϏεΞʔΩςΫνϟ • ҰͭͷׂΛͬͨૄ݁߹Ͱখ͞ͳαʔϏε ʢίϯϙʔωϯτʣͷू߹Ͱେ͖ͳαʔϏε ʢΞϓϦέʔγϣϯʣΛߏங͢Δ • ͦΕͧΕͷαʔϏεDockerίϯςφEC2 Πϯελϯεͱͯ͠දݱ͞ΕΔ • ϚΠΫϩαʔϏεಉ࢜HTTPSͳͲͰ௨৴
© NGINX via https://www.nginx.com/blog/service-discovery-in-a-microservices-architecture/
࣮ࡍͲ͏ͳͷ • ScalaMatsuri 2016Ͱ৭ʑͳηογϣϯΛ ฉ͍ͯདྷ·͕ͨ͠ʮϦΞΫςΟϒʯʮϚΠΫϩ αʔϏεʯʹ·ͭΘΔηογϣϯ͕ଟ • ຊͷํΑΓւ֎ͷํͷηογϣϯଟ͠ ˠ ւ֎ͰطʹσϑΝΫτʹͳ͖ͬͯͯͦ͏
• “ϦΞΫςΟϒResiliencyͷͨΊͷखஈͰ͋Δ”
ߋʹઌΛோΊΔ
ͦͷઌʹ߇͑Δͷ ͕ओମͷΞʔΩςΫνϟ
AWS Lambda ͕ओମ • όοΫΤϯυʹ͋Δmicro servicesͷ ΦʔέετϨʔγϣϯͰͳ͍ • υϝΠϯϩδοΫ͕AWS Lambda
Functionͱ ͯ͠දݱ͞ΕΔαʔόʔϨεΞʔΩςΫνϟ • ୯Ґ͕ micro services ͔Β functions
Evolution of Compute – Public Cloud Infrastructure Instances Application code
©Amazon Web Services via http://www.slideshare.net/AmazonWebServices/arc308-the-serverless-company-using-aws-lambda/
Evolution of Compute – Containers Infrastructure Instances Application code Containers
©Amazon Web Services via http://www.slideshare.net/AmazonWebServices/arc308-the-serverless-company-using-aws-lambda/
Evolution of Compute – Serverless Application code ©Amazon Web Services
via http://www.slideshare.net/AmazonWebServices/arc308-the-serverless-company-using-aws-lambda/
࣮ࡍͲ͏ͳͷ • AWS re:Invent 2015ͰϚΠΫϩαʔϏεؔ࿈ͷηο γϣϯ͕ଟ͘ൃද͞ΕΔதͰɺੈքʹ͚ͯൃ৴͞Ε ͨ֓೦ʢൃද͞Εͨͷ͢Ͱʹ࣮ફ͞Εͨͷʣ • ͍ͣΕɺඞͣདྷΔαʔόʔϨεͷະདྷΛ͍ͯ͠Δ •
ͦͷ”ະདྷ”͕དྷΔͷ͜ͱΛɺ ݸਓతʹ”Lambda Xσʔ”ͱݺΜͰ·͢
None
ਂΈʹμΠϒ͍ͨ͠ํฐࣾ୮ͷهࣄΛͥͻνΣοΫʂ reinvent2015 ϚΠΫϩαʔϏε
For Your Information
2015.02 Lambda in VPC!! ©Amazon Web Services via http://aws.typepad.com/aws_japan/2016/02/access-resources-in-a-vpc-from-your- lambda-functions.html
ͯ͞
ͰΞϓϦέʔγϣϯ Λ։ൃ͢Δ߹ͷબࢶ
None
None
None
Scala in AWS Lambda • LambdaScalaͰॻ͚·͢ɻ͜ΕScalaʹݶͬͨ Ͱͳ͘ɺJVMݴޠͳΒOKɻ • ͬ͟ͱࢼͨ͠ײ͡ͰແཧΓײ͕ͰΔ͜ͱͳ͘ɺ ͍͍ײ͡ʹॻ͚·͢ɻ
• ٕज़ௐࠪΛਐΊ͍ͯͯɺ͏গ͠φϨοδ͕ཷ·Ε ͍ۙ͏ͪʹຊ൪ద༻ՄೳʹͳΓͦ͏ɻ
Scala in AWS Lambda • LambdaScalaͰॻ͚·͢ɻ͜ΕScalaʹݶͬͨ Ͱͳ͘ɺJVMݴޠͳΒOKɻ • ͬ͟ͱࢼͨ͠ײ͡ͰແཧΓײ͕ͰΔ ͜ͱͳ͘ɺ͍͍ײ͡ʹॻ͚·͢ɻ
• ٕज़ௐࠪΛਐΊ͍ͯͯɺ͏গ͠φϨοδ͕ཷ·Ε ͍ۙ͏ͪʹຊ൪ద༻ՄೳʹͳΓͦ͏ɻ ͜ͷลΓΛ۷ΓԼ͛ΔΛ݄̑ʹԬͰ͠·͢ʂ ʲScalaԬ2016ʳͰݕࡧݕࡧʂ
ͳͥScalaΛબͿ͖͔ • AWS LambdaΛ͏্ͰΓӽ͑ͳ͚ΕͳΒͳ ͍ͷ”݁߹ςετͷॻ͖ʹ͘͞” • ݁߹ςετΨϯΨϯॻ͍ͯͽΎΜͽΎΜਐΊΑ͏ͥ ͱ͍͏จԽͱ͏·͘߹க͠ͳ͍ • ϢχοτςετͷΈͰΑΓଟ͘ͷ৺ࣄΛ
ղফ͢ΔʹͲ͏͖͔͢
ͳͥScalaΛબͿ͖͔ • AWS LambdaΛ͏্ͰΓӽ͑ͳ͚ΕͳΒͳ ͍ͷ”݁߹ςετͷॻ͖ʹ͘͞” • ݁߹ςετΨϯΨϯॻ͍ͯͽΎΜͽΎΜਐΊΑ͏ͥ ͱ͍͏จԽͱ͏·͘߹க͠ͳ͍ • ϢχοτςετͷΈͰΑΓଟ͘ͷ৺ࣄΛ
ղফ͢ΔʹͲ͏͖͔͢ ڧ͍੩తܕγεςϜͷݎ࿚͞ͱ ؔܕͷҟৗܥදݱྗΛۦ͢͠ʂ
rapture.core.Result via https://github.com/propensive/rapture
scalaz.\/ via https://github.com/scalaz/scalaz ʢEitherT͋ΔΜͩΑʂʣ
scala.util.Either via https://github.com/scala/scala
ؔܕͷҟৗܥදݱྗ • ͋ΔৼΔ͍Λςετ͢Δʹ͋ͨΓɺͦͷৼ Δ͍͕ى͜͢෭࡞༻ࠐΈͰςετ͢ΔͷͰ ͳ͘ɺҟৗܥIOΞΫηεΛදݱՄೳͳܕ Λѻ͍ɺ෭࡞༻ͷൃੜՕॴΛΪϦΪϦ·ͰΞ ϓϦέʔγϣϯͷ֎ଆʹ࣋ͪӽ͢Α͏ʹ͢Δ ͜ͱͰɺ෭࡞༻ൃੜલͷ͕ਖ਼͍͜͠ͱ ʢ==ʣΛอূ͢Δςετ͕ॻ͚Δɻ
ݱঢ়ͷࡉ͔͍Cons • Artifact ZIPʹ50MB੍ݶ͕͋Δ → ࡞ΓํΛ͢Δඞཁ͕͋Δͷͷɺ ɹ ϚΠΫϩαʔϏεͷߟ͑ํΛܧঝ͢ΔͳΒ ɹ ରॲՄೳͳ੍ݶ
• JVMͷॳճىಈίετ͕Φʔόʔϔουʹʁ ˠ Lambda in VPCͳΒENIίετ͋ΔͷͰɺ ɹ ॳճ͍ͷͱׂΓΔ
Ұ൪͔͑ͨͬͨࣄͳͷͰ ͪΐͬͱৼΓฦΓ
ͳͥAWS࣌ʹScala͔ • Lambda XσʔඞͣདྷΔ • େنΞϓϦΛLambdaͰ࡞Δ͕͘Δ • AWS݁߹ςετΛແཧΓॻ͘ͷͰͳ͘ ϢχοτςετͰ୲อͰ͖ΔྖҬΛ૿͢ •
ͦ͏͍͏ॻ͖ํΛڧ͘αϙʔτ͍ͯ͠Δͷ͕Scala
Today's topics • Scalaͷoverview • ScalaΛͬͨϞόΠϧόοΫΤϯυAPI • ͳͥAWSωΠςΟϒͷ࣌ʹScala͕ඞཁ͔ • How
to આಘ your client in "Scala͍·͢!"
How to આಘ your client in "Scala͍͍ͨ!"
"Play-ScalaΛ͍·͢!" ͱ͍͏ఏҊΛ͢ΔͨΊʹ ͍͔ͭ͘ͷFrameworkͱ ൺֱݕ౼Λߦ͏ඞཁ͕͋ͬͨ
දతFramework • Ruby on Rails (Ruby) • Express (Node.js) •
Laravel (PHP) • Play Framework (Java) • etc
લḗઓ vs Rails, Node, PHP
vs Rails, Node, PHP • Play-ScalaͱղܾͷϞσϧ͕͖ͬΓ ҧ͏ͷͰɺઆ໌ʢઆಘʣ͍͢͠ɻ • োੑʢResiliencyʣ, ৳ॖੑʢElasticityʣ
৴པੑʢReliabilityʣͳͲͰѹউ͢Δɻ • ڧ͍ͯݴ͑1ΠϯελϯεͰC100Kͷޭ͕͋Δ Node͕Ұ൪ͷϥΠόϧɻ
োੑʢResiliencyʣ • AkkaͷFault ToleranceઓུErlang/OTPͳͲ ͱฒͼ࠷ڧΫϥεͷোੑΛఏڙ • ΈΛཧղͯ͠ਖ਼͑͘͠ɺۚ༥ج൫ Πϯϑϥج൫ʹ༻͍͏ΔϨϕϧ • લḗઓͰઆಘͷϝΠϯΣϙϯ
৳ॖੑʢElasticityʣ • ٛͰͷεέʔϥϏϦςΟ • AkkaϕʔεͷΫϥελϦϯά͕༰қ • PlayAkkaͷΈͷ্Ͱಈ͍͍ͯΔ • Play-Scalaͷ୯ମॲཧੑೳNodeΑΓߴ͍ ˞
2015/05࣌ͷϕϯνϚʔΫ
৴པੑʢReliabilityʣ • ͳΜ͔ͩΜͩݴͬͯJVMͰಈ͘ΞϓϦ • JVMͷྺ࢙ͱ৴པੑΛͦͷ··Ҿ͖ܧ͙͜ͱ͕Ͱ ͖Δ • νϡʔχϯά͔Βӡ༻·Ͱ࣮ɾจݙͱʹ๛ • javapίϚϯυͳͲͰղੳ͢Δͱ݁ߏಡΊ·͢
োੑɺ৳ॖੑɺ৴པੑΛ ͔ͬ͠Γ͑Ε Rails, Node, PHPʹ ڝΓෛ͚Δ͜ͱͳ͍ ※ APIαʔόʔ։ൃͷͰ͢
߈ෆམ vs Java
ઌ΄Ͳڍ͛ͨ োੑɺ৳ॖੑɺ৴པੑ ͦΕͧΕ Play, Akka → োੑ Akka → ৳ॖੑ
JVM → ৴པੑ
Play-Java
Akka for Java
JVM
͑ͬɺ ͦΕJavaͰ͍͍Ͱ͢ΑͶʁ
߈ෆམ vs Java
JavaΑΓScalaΛ͍͍ͨཧ༝ • ίʔυهड़ྔ͕ѹతʹগͳ͍ʢφ͍ʣ • ؔܕͰॻ͚Δʢφ͍ʣ • Akka, PlayScalaͰॻ͔ΕͯΔ͔Β͍͍͢ • …͚ͩ͡Όͳ͘Sparkͱ͔Kafkaͱ͔࠷ۙͷ
ॏཁͳOSS͕ScalaͰॻ͔Ε·ͬͯ͘Δʢφ͍ʣ
JavaΛͬͯ΄͍͠ཧ༝ • ݴޠऀͷ͕ѹతʹଟ͍ • Ώ͑ʹϋΠΞϦϯάָ͕ • Ώ͑ʹอकɾӡ༻ମ੍Λཱ͍ͯ͢ • Ώ͑ʹ҆৺ײ͕͋Δ
ຊʹͦ͏Ͱ͠ΐ͏͔ʁ
Java8Λ࣮ϨϕϧͰॻ͚Δ ΤϯδχΞͬͯ ͦΜͳʹଟ͍ΜͰ͠ΐ͏͔ (StreamAPIʹflatMapͱ͔͋Γ·͚͢ͲͦΕେৎͳΜͰ͔͢Ͷ) ※ScalaʹSwiftʹHaskell(*bind)ʹ͋ΔΑʂ
Java8ऀ͔ͭDDDऀͷ ΤϯδχΞͷϋΠΞϦϯά ͬͯͦΜͳʹָͰ͠ΐ͏͔
Java7ऀΛҭͯΕΑ͍ʁ
ͳΒScalaͰ Γ·͠ΐ͏ʂ
"JavaΑΓScala"Λઆಘ͢Δ • ScalaΛͬͨ߹ͷརΛઆ໌͠ • Java8ऀ͕ඞͣ͠ଟ͘ͳ͘ɺ͔ͭJava8ʹ ͔ͳΓֶशίετ͕͔͔Δ͜ͱΛઆ໌͠ • ʢ্࢘ʹʣಉֶ͡शίετΛ͏ͳΒScalaΛ͏͖ ͩͱ͑Δ͠ʂ •
ʢ͓٬͞ΜʹʣScalaͰϦεΫେࠩͳ͍ͱ͑Δ͠ʂ
࣌ؒʹ༨༟͕͋Ε͜͜Ͱ ScalaѪΛޠΔ ిܸɺॳ࿀ɺ૬खͷ͜ͱͬͱΓ͍ͨɺ…
·ͱΊ
·ͱΊ • ScalaؔܕͰ͖ΔOOPݴޠͰ͢Αʂ • དྷΔLambda XσʔʹɺScala։ൃऀʹଟ͘ͷ ͤΛͨΒ͢Ͱ͠ΐ͏ɻ • Resiliency, Elasticity,
Reliability!! • ScalaΛ͏རΛ͔ͬ͠Γઆ໌্ͨ͠Ͱ “JavaͳΒ҆৺” ͱ͍͏ݬΛͿͪյ͢ʂ
None
%FWFMPQFST*0 ͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ εϥΠυޙϒϩάͰެ։͠·͢ɻ " ⡥$MBTTNFUIPE *OD #cmdevio2016