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
660
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.9k
Play Scala on AWS, C10K and DevOps
cmaraiyusuke
2
1.3k
Other Decks in Technology
See All in Technology
Python(PYNQ)がテーマのAMD主催のFPGAコンテストに参加してきた
iotengineer22
0
470
スクラムチームを立ち上げる〜チーム開発で得られたもの・得られなかったもの〜
ohnoeight
2
350
AGIについてChatGPTに聞いてみた
blueb
0
130
誰も全体を知らない ~ ロールの垣根を超えて引き上げる開発生産性 / Boosting Development Productivity Across Roles
kakehashi
1
220
Terraform未経験の御様に対してどの ように導⼊を進めていったか
tkikuchi
2
430
The Role of Developer Relations in AI Product Success.
giftojabu1
0
120
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
250
ドメインの本質を掴む / Get the essence of the domain
sinsoku
2
150
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.8k
透過型SMTPプロキシによる送信メールの可観測性向上: Update Edition / Improved observability of outgoing emails with transparent smtp proxy: Update edition
linyows
2
210
B2B SaaSから見た最近のC#/.NETの進化
sansantech
PRO
0
750
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
A better future with KSS
kneath
238
17k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Into the Great Unknown - MozCon
thekraken
32
1.5k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
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