![Page 1: TCE introduction (scalability with Scala and Akka)](https://reader030.vdocuments.us/reader030/viewer/2022020101/559454801a28ab92118b458c/html5/thumbnails/1.jpg)
Scala-bility
martes 10 de septiembre de 13
![Page 2: TCE introduction (scalability with Scala and Akka)](https://reader030.vdocuments.us/reader030/viewer/2022020101/559454801a28ab92118b458c/html5/thumbnails/2.jpg)
Puzzle: what is on the Y axis???
martes 10 de septiembre de 13
![Page 3: TCE introduction (scalability with Scala and Akka)](https://reader030.vdocuments.us/reader030/viewer/2022020101/559454801a28ab92118b458c/html5/thumbnails/3.jpg)
OMG, these MHzes don’t grow
anymore :(martes 10 de septiembre de 13
![Page 4: TCE introduction (scalability with Scala and Akka)](https://reader030.vdocuments.us/reader030/viewer/2022020101/559454801a28ab92118b458c/html5/thumbnails/4.jpg)
But imagine a beowulf cluster of
these!!!martes 10 de septiembre de 13
![Page 5: TCE introduction (scalability with Scala and Akka)](https://reader030.vdocuments.us/reader030/viewer/2022020101/559454801a28ab92118b458c/html5/thumbnails/5.jpg)
Is it possible to handle multiple tasks and not suffer?!
martes 10 de septiembre de 13
![Page 6: TCE introduction (scalability with Scala and Akka)](https://reader030.vdocuments.us/reader030/viewer/2022020101/559454801a28ab92118b458c/html5/thumbnails/6.jpg)
DEMO
martes 10 de septiembre de 13
![Page 7: TCE introduction (scalability with Scala and Akka)](https://reader030.vdocuments.us/reader030/viewer/2022020101/559454801a28ab92118b458c/html5/thumbnails/7.jpg)
We do it for ages!UNIX pipes connect parallel processes
easily:* Deterministic* Composable
martes 10 de septiembre de 13
![Page 8: TCE introduction (scalability with Scala and Akka)](https://reader030.vdocuments.us/reader030/viewer/2022020101/559454801a28ab92118b458c/html5/thumbnails/8.jpg)
Why is it so easy to be parallel with *nix CLI?
Designed to be parallel from the ground up
Designed to be functional from the ground up
Autonomic composable units of execution
martes 10 de septiembre de 13
![Page 9: TCE introduction (scalability with Scala and Akka)](https://reader030.vdocuments.us/reader030/viewer/2022020101/559454801a28ab92118b458c/html5/thumbnails/9.jpg)
Pipe example in Java
martes 10 de septiembre de 13
![Page 10: TCE introduction (scalability with Scala and Akka)](https://reader030.vdocuments.us/reader030/viewer/2022020101/559454801a28ab92118b458c/html5/thumbnails/10.jpg)
Are we there yet?Reliability?
Availability?Diagnostics?Distribution?
martes 10 de septiembre de 13
![Page 11: TCE introduction (scalability with Scala and Akka)](https://reader030.vdocuments.us/reader030/viewer/2022020101/559454801a28ab92118b458c/html5/thumbnails/11.jpg)
Doing it in Java built-inssynchronize, volatile
Collections.synchronized*
java.util.concurrent
java.nio
fork/join
martes 10 de septiembre de 13
![Page 12: TCE introduction (scalability with Scala and Akka)](https://reader030.vdocuments.us/reader030/viewer/2022020101/559454801a28ab92118b458c/html5/thumbnails/12.jpg)
High-level tools for Java async
Camel
Spring Integration
GridGain
Akka
martes 10 de septiembre de 13
![Page 13: TCE introduction (scalability with Scala and Akka)](https://reader030.vdocuments.us/reader030/viewer/2022020101/559454801a28ab92118b458c/html5/thumbnails/13.jpg)
Today we cover only two
Akka: you can stay in Java and scale vertically/horizontally - transparently
Scala: being functional allows to be parallel - easily
martes 10 de septiembre de 13
![Page 14: TCE introduction (scalability with Scala and Akka)](https://reader030.vdocuments.us/reader030/viewer/2022020101/559454801a28ab92118b458c/html5/thumbnails/14.jpg)
Scala: being functional
High order functions
Immutable data
Referential transparency
Lazy evaluation
Recursion (RecursiveAction, anyone?)
martes 10 de septiembre de 13
![Page 15: TCE introduction (scalability with Scala and Akka)](https://reader030.vdocuments.us/reader030/viewer/2022020101/559454801a28ab92118b458c/html5/thumbnails/15.jpg)
Scala: if you’re functional, you can be
parallel
import Math._
val r = 0 until 10000000 def f(x: Int) = log10 (pow(3,x *sin(x))) val m = r. map ( f )
r. forall ( i=> f(i)==m(i) ) //10seconds r. par. forall ( i=> f(i)==m(i) ) //5seconds
martes 10 de septiembre de 13
![Page 16: TCE introduction (scalability with Scala and Akka)](https://reader030.vdocuments.us/reader030/viewer/2022020101/559454801a28ab92118b458c/html5/thumbnails/16.jpg)
Same JVM, different languagesYou don’t have to choose. You can mix
them in the same project.
martes 10 de septiembre de 13
![Page 17: TCE introduction (scalability with Scala and Akka)](https://reader030.vdocuments.us/reader030/viewer/2022020101/559454801a28ab92118b458c/html5/thumbnails/17.jpg)
Right guys to follow ...Martin Odersky
Rod JohnsonJonas Bonér
martes 10 de septiembre de 13
![Page 18: TCE introduction (scalability with Scala and Akka)](https://reader030.vdocuments.us/reader030/viewer/2022020101/559454801a28ab92118b458c/html5/thumbnails/18.jpg)
... they already use it in
production
martes 10 de septiembre de 13
![Page 19: TCE introduction (scalability with Scala and Akka)](https://reader030.vdocuments.us/reader030/viewer/2022020101/559454801a28ab92118b458c/html5/thumbnails/19.jpg)
Links
http://www.slideshare.net/djspiewak/high-wizardry-in-the-land-of-scala
http://www.forbes.com/sites/quentinhardy/2011/05/12/names-you-need-to-know-scala-and-typeface/
http://www.slinnbooks.com/books/futures/
http://mandubian.com/2012/08/27/understanding-play2-iteratees-for-normal-humans/
martes 10 de septiembre de 13